Package com.reign.api.lib.providers
Class ApiHttpProvider
java.lang.Object
com.reign.api.lib.providers.ApiHttpProvider
- All Implemented Interfaces:
IApiProvider
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends ApiModel,
Y extends ApiResponse<?>>
boolean<Y extends ApiResponse<?>>
Y<T,
Y> T Base method for all POST requests
-
Field Details
-
log
protected static final org.slf4j.Logger log
-
-
Constructor Details
-
ApiHttpProvider
public ApiHttpProvider()
-
-
Method Details
-
commit
public <T extends ApiModel,Y extends ApiResponse<?>> boolean commit(String endpoint, T apiModel, Class<Y> responseClass) - Specified by:
commit
in interfaceIApiProvider
-
fetch
- Specified by:
fetch
in interfaceIApiProvider
-
post
Base method for all POST requests- Type Parameters:
T
- T JSON-Serializable class which the response will be serialized into.Y
- Y JSON-Serializable object which the request body will be transformed from.- Parameters:
endpoint
- Request URI.response
- Class in which the response will be serialized into.body
- JSON-Serializable object containing the body data.- Returns:
- Generic T; Serialized JSON data into an object of type T response.
-