Class PassageHttpClientImpl
java.lang.Object
id.passageidentity.passage4j.core.http.PassageHttpClientImpl
- All Implemented Interfaces:
PassageHttpClient
Implementation of the PassageHttpClient interface.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a PassageHttpClientImpl object without an authorization header.PassageHttpClientImpl(String authorizationHeader) Constructs a PassageHttpClientImpl object with the specified authorization header. -
Method Summary
Modifier and TypeMethodDescription<T> HTTPResponse<T>Sends an HTTP DELETE request to the specified URL and returns the response.<T> HTTPResponse<T>Sends an HTTP GET request to the specified URL and returns the response.<T> HTTPResponse<T>Sends an HTTP PATCH request to the specified URL and returns the response.<T> HTTPResponse<T>patch(String url, Object requestBody, com.fasterxml.jackson.core.type.TypeReference<T> responseType) Sends an HTTP PATCH request to the specified URL with the given request body and returns the response.<T> HTTPResponse<T>Sends an HTTP POST request to the specified URL with the given request body and returns the response.
-
Constructor Details
-
PassageHttpClientImpl
Constructs a PassageHttpClientImpl object with the specified authorization header.- Parameters:
authorizationHeader- The authorization header to be used in requests.
-
PassageHttpClientImpl
public PassageHttpClientImpl()Constructs a PassageHttpClientImpl object without an authorization header.
-
-
Method Details
-
get
public <T> HTTPResponse<T> get(String url, com.fasterxml.jackson.core.type.TypeReference<T> responseType) throws Exception Sends an HTTP GET request to the specified URL and returns the response.- Specified by:
getin interfacePassageHttpClient- Type Parameters:
T- The type of the response.- Parameters:
url- The URL to send the request to.responseType- The type of the response.- Returns:
- The HTTP response.
- Throws:
Exception- if an error occurs while making the request.
-
post
public <T> HTTPResponse<T> post(String url, Object requestBody, com.fasterxml.jackson.core.type.TypeReference<T> responseType) throws Exception Sends an HTTP POST request to the specified URL with the given request body and returns the response.- Specified by:
postin interfacePassageHttpClient- Type Parameters:
T- The type of the response.- Parameters:
url- The URL to send the request to.requestBody- The request body.responseType- The type of the response.- Returns:
- The HTTP response.
- Throws:
Exception- if an error occurs while making the request.
-
delete
public <T> HTTPResponse<T> delete(String url, com.fasterxml.jackson.core.type.TypeReference<T> responseType) throws Exception Sends an HTTP DELETE request to the specified URL and returns the response.- Specified by:
deletein interfacePassageHttpClient- Type Parameters:
T- The type of the response.- Parameters:
url- The URL to send the request to.responseType- The type of the response.- Returns:
- The HTTP response.
- Throws:
Exception- if an error occurs while making the request.
-
patch
public <T> HTTPResponse<T> patch(String url, Object requestBody, com.fasterxml.jackson.core.type.TypeReference<T> responseType) throws Exception Sends an HTTP PATCH request to the specified URL with the given request body and returns the response.- Specified by:
patchin interfacePassageHttpClient- Type Parameters:
T- The type of the response.- Parameters:
url- The URL to send the request to.requestBody- The request body.responseType- The type of the response.- Returns:
- The HTTP response.
- Throws:
Exception- if an error occurs while making the request.
-
patch
public <T> HTTPResponse<T> patch(String url, com.fasterxml.jackson.core.type.TypeReference<T> responseType) throws Exception Sends an HTTP PATCH request to the specified URL and returns the response.- Specified by:
patchin interfacePassageHttpClient- Type Parameters:
T- The type of the response.- Parameters:
url- The URL to send the request to.responseType- The type of the response.- Returns:
- The HTTP response.
- Throws:
Exception- if an error occurs while making the request.
-