Package de.qytera.qtaf.http
Class HTTPDao
java.lang.Object
de.qytera.qtaf.http.HTTPDao
- Direct Known Subclasses:
HTTPJsonDao
HTTP DAO.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsePerform DELETE Requests.protected <T> TPerform DELETE Requests.deleteAsString(String path, String mediaType) Perform DELETE Requests.jakarta.ws.rs.core.ResponsePerform GET Requests.protected <T> TPerform GET Requests.getAsString(String path, String mediaType) Perform GET Requests.Get authorizationHeaderValue.protected <T> TPerform POST Requests.jakarta.ws.rs.core.ResponsePerform POST Requests.postAsString(String path, String mediaType, Object requestEntity) Perform POST Requests.protected <T> TPerform PUT Requests.jakarta.ws.rs.core.ResponsePerform PUT Requests.putAsString(String path, String mediaType, Object requestEntity) Perform PUT Requests.setAuthorizationHeaderValue(String authorizationHeaderValue) Set authorizationHeaderValue.
-
Field Details
-
client
protected jakarta.ws.rs.client.Client clientWeb Client that can perform HTTP Requests. -
host
Host: domain name (i.e. "https://www.google.de") or IP-Address (i.e. "8.8.8.8"). -
authorizationHeaderValue
Authorization header value. -
gson
protected final com.google.gson.Gson gsonString to JSON converter.
-
-
Constructor Details
-
HTTPDao
Constructor.- Parameters:
host- host name
-
-
Method Details
-
getAuthorizationHeaderValue
Get authorizationHeaderValue.- Returns:
- authorizationHeaderValue
-
setAuthorizationHeaderValue
Set authorizationHeaderValue.- Parameters:
authorizationHeaderValue- AuthorizationHeaderValue- Returns:
- this
-
get
Perform GET Requests.- Type Parameters:
T- Type that the Result gets mapped to- Parameters:
path- Url PathmediaType- the request's media typec- Class that the result gets mapped to- Returns:
- Response of Type T
-
get
Perform GET Requests.- Parameters:
path- Url PathmediaType- Media Type- Returns:
- Response
-
getAsString
Perform GET Requests.- Parameters:
path- Url PathmediaType- Media Type- Returns:
- Response
-
post
Perform POST Requests.- Type Parameters:
T- Type that the Result gets mapped to- Parameters:
path- Url PathmediaType- the request's media typec- Class that the result gets mapped torequestEntity- Request body- Returns:
- Response of Type T
-
post
Perform POST Requests.- Parameters:
path- Url PathmediaType- Media TyperequestEntity- Request body- Returns:
- Response
-
postAsString
Perform POST Requests.- Parameters:
path- Url PathmediaType- Media TyperequestEntity- Request body- Returns:
- Response
-
put
Perform PUT Requests.- Type Parameters:
T- Type that the Result gets mapped to- Parameters:
path- Url PathmediaType- the request's media typec- Class that the result gets mapped torequestEntity- Request body- Returns:
- Response of Type T
-
put
Perform PUT Requests.- Parameters:
path- Url PathmediaType- Media TyperequestEntity- Request body- Returns:
- Response
-
putAsString
Perform PUT Requests.- Parameters:
path- Url PathmediaType- Media TyperequestEntity- Request body- Returns:
- Response
-
delete
Perform DELETE Requests.- Type Parameters:
T- Type that the Result gets mapped to- Parameters:
path- Url PathmediaType- the request's media typec- Class that the result gets mapped to- Returns:
- Response of Type T
-
delete
Perform DELETE Requests.- Parameters:
path- Url PathmediaType- Media Type- Returns:
- Response
-
deleteAsString
Perform DELETE Requests.- Parameters:
path- Url PathmediaType- Media Type- Returns:
- Response
-