Java framework for making REST clients

Overview

Pocolifo's REST Client Framework

Java framework for making REST clients

testing


Here's how easy it is

Here's an example for a GET request in the context of a service status request:

package my.awesome.api.client.request;

import com.pocolifo.restclientframework.request.Endpoint;
import com.pocolifo.restclientframework.request.methods.get.GetRequest;

@Endpoint("https://api.awesome.com")
public class ServiceStatusRequest extends GetRequest<ServiceStatusResponse> {}

You would then have a ServiceStatusResponse class:

package my.awesome.api.client.response;

import com.google.gson.annotations.SerializedName;
import com.pocolifo.restclientframework.response.ResponseHeader;

public class ServiceStatusResponse {
    
    @SerializedName("version")
    public String version;
    
    @ResponseHeader("server")
    public String apiServerHeader;
    
}

A GET request, but with some parameters:

package my.awesome.api.client.request;

import com.pocolifo.restclientframework.request.Endpoint;
import com.pocolifo.restclientframework.request.methods.get.GetRequest;
import com.pocolifo.restclientframework.request.RequestParameter;

@Endpoint("https://api.awesome.com/items/%itemId%")
public class GetItemRequest extends GetRequest<ItemResponse> {
    
    @RequestParameter
    public String itemId;
    
}

Then the response template:

package my.awesome.api.client.response;

import com.google.gson.annotations.SerializedName;

public class ItemResponse {
    
    @SerializedName("id")
    public String id;
    
    @SerializedName("name")
    public String name;
    
}

You can also add headers to the request you make. Note that these variables must be of the String type.

package my.awesome.api.client.request;

import com.pocolifo.restclientframework.request.Endpoint;
import com.pocolifo.restclientframework.response.ResponseHeader;

@Endpoint("https://api.awesome.com/items/put")
public class PutNewItemRequest {
    
    @ResponseHeader("X-Authentication-Method")
    public String authMethod;

    @ResponseHeader("X-Authentication-Key")
    public String authKey;

}
You might also like...

Adds support for using InputStream/OutputStream from Spring's web clients

Spring stream interoperability This project offers three integrations: A WebClientHttpRequestFactory that redirects the RestTemplate API calls to a We

Dec 18, 2022

A plugin that open the GC command execution interface for third-party clients

gc-opencommand-plugin 中文 | English 一个为第三方客户端开放GC命令执行接口的插件 服务端安装 在 Release 下载 jar 放入 plugins 文件夹即可 控制台连接 首次启动时,会在 plugins 目录下生成一个 opencommand-plugin 目录

Jan 1, 2023

Rate limiting private REST APIs using Java Spring-boot, spring-security and bucket4j

Rate limiting REST APIs using Spring-security filter and Bucket4J Deployed Application (Swagger-ui on heroku) Inspired from: Baeldung Article Applicat

Jul 18, 2022

Desafio Alura Challenge para backend. Criando uma API REST de controle de orçamento utilizando JAVA.

Desafio Alura Challenge para backend. Criando uma API REST de controle de orçamento utilizando JAVA.

Jun 16, 2022

See how simple it is to build a REST API with a database using Java and Spring Boot

See how simple it is to build a REST API with a database using Java and Spring Boot

Seu primeiro projeto Java Web no Spring Boot 2022 Veja como é simples construir uma API REST com banco de dados usando Java e Spring Boot Realização D

Dec 26, 2022

Spring REST API for financial management, developed with Java 11, JWT for authentication, JUnit for unit testing and Oracle Database

Spring REST API for financial management, developed with Java 11, JWT for authentication, JUnit for unit testing and Oracle Database

control_financial Spring REST API for financial management, developed with Java 11, JWT for authentication, JUnit for unit testing and Oracle Database

May 27, 2022

API REST feita 100% em Java com Spring

API REST feita 100% em Java com Spring

May 8, 2022

Warehouse management REST API with Java & Spring Boot

Warehouse management REST API with Java & Spring Boot

Spring Warehouse Spring Warehouse is a Java Spring Boot REST API that has the purpose of managing products and articles in your warehouse. This projec

Dec 15, 2022

F5 BIG-IP iControl REST vulnerability RCE exploit with Java including a testing LAB

F5 BIG-IP iControl REST vulnerability RCE exploit with Java including a testing LAB

CVE-2022-1388 F5 BIG-IP iControl REST vulnerability RCE exploit with Java and ELF. Included Scan a single target Scan many targets Exploit with a shel

Sep 24, 2022
Releases(1.3.2)
Owner
null
Drone - A service via REST API that allows clients to communicate with drones

Drone - A service via REST API that allows clients to communicate with drones (i.e. **dispatch controller**). The specific communication with the drone is outside the scope of this task.

Obinna Ogbonna 1 Jan 10, 2022
Silicon Copéllia is a software for making robots response affactively to other agents.

Silicon Copéllia is a software for making robots response affactively to other agents. This project aims to cope with the number produced by Copéllia during the affection/emotion processing process and make Copéllia talks by applying NLP.

null 1 May 26, 2022
A repository that will guide in making your first contribution.

Java Programs A Repository that will guide you in making your first contribution. How to contribute Fork the project Make any changes in your forked r

Sujana Kamasany 18 Jan 6, 2023
💡极致性能的企业级Java服务器框架,RPC,游戏服务器框架,web应用服务器框架。(Extreme fast enterprise Java server framework, can be RPC, game server framework, web server framework.)

?? 为性能而生的万能服务器框架 ?? Ⅰ. zfoo简介 ?? 性能炸裂,天生异步,Actor设计思想,无锁化设计,基于Spring的MVC式用法的万能RPC框架 极致序列化,原生集成的目前二进制序列化和反序列化速度最快的 zfoo protocol 作为网络通讯协议 高可拓展性,单台服务器部署,

null 1k Jan 1, 2023
RESTX, the lightweight Java REST framework

RESTX - the lightweight Java REST framework RESTX is a full lightweight disrupting stack, which includes Swagger-like ui & considers REST specs tests

null 437 Oct 22, 2022
The Quotation Management application is a API REST created using Spring Boot framework.

✅ Quotation Management API - Done ✅ About • Features • Setup • Technologies • Author • License ?? About The Quotation Management application is a API

Vanessa Swerts 6 Apr 29, 2022
The Apache Software Foundation 605 Dec 30, 2022
A singular file to protect as many Minecraft servers and clients as possible from the Log4j exploit (CVE-2021-44228).

MC-Log4J-Patcher The goal of this project is to provide Minecraft players, and server owners, peace of mind in regards to the recently discovered Log4

Koupa Taylor 4 Jan 4, 2022
An Xposed module for Telegram clients

TMoe TMoe 是一个兼容若干第三方开源 Telegram 客户端的开源 Xposed 模块 使用方法 激活本模块后,在 Telegram 客户端的设置中点击 "TMoe 设置" 即可开关对应功能。 一切开发旨在学习,请勿用于非法用途 本项目保证永久开源,欢迎提交 Issue 或者 Pull R

Acetylcholine 355 Dec 31, 2022
A platform that links service providers with clients using Angular & Springboot

Bricoly : Engineer Your Life The Way It Should Be... ?? Description This project's aims to connect people who are able to grant services with clients

Yasser Douslimi 9 May 28, 2022