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 Requestsprotected <T> TPerform DELETE RequestsdeleteAsString(String path, String mediaType) Perform DELETE Requestsjakarta.ws.rs.core.ResponsePerform GET Requestsprotected <T> TPerform GET RequestsgetAsString(String path, String mediaType) Perform GET RequestsGet authorizationHeaderValueprotected <T> TPerform POST Requestsjakarta.ws.rs.core.ResponsePerform POST RequestspostAsString(String path, String mediaType, Object requestEntity) Perform POST Requestsprotected <T> TPerform PUT Requestsjakarta.ws.rs.core.ResponsePerform PUT RequestsputAsString(String path, String mediaType, Object requestEntity) Perform PUT RequestssetAuthorizationHeaderValue(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
-