Package de.qytera.qtaf.core.net.http
Class HTTPDao
java.lang.Object
de.qytera.qtaf.core.net.http.HTTPDao
- Direct Known Subclasses:
HTTPJsonDao
HTTP DAO
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.sun.jersey.api.client.ClientResponsePerform DELETE Requestsprotected <T> TPerform DELETE RequestsdeleteAsString(String path, String mediaType) Perform DELETE Requestscom.sun.jersey.api.client.ClientResponsePerform GET Requestsprotected <T> TPerform GET RequestsgetAsString(String path, String mediaType) Perform GET RequestsGet authorizationHeaderValueprotected <T> TPerform POST Requestscom.sun.jersey.api.client.ClientResponsePerform POST RequestspostAsString(String path, String mediaType, Object requestEntity) Perform POST Requestsprotected <T> TPerform PUT Requestscom.sun.jersey.api.client.ClientResponsePerform PUT RequestsputAsString(String path, String mediaType, Object requestEntity) Perform PUT RequestssetAuthorizationHeaderValue(String authorizationHeaderValue) Set authorizationHeaderValue
-
Field Details
-
client
protected com.sun.jersey.api.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 Pathc- 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 Pathc- Class that the result gets mapped torequestEntity- Request body- Returns:
- Response of Type T
-
post
public com.sun.jersey.api.client.ClientResponse post(String path, String mediaType, Object requestEntity) 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 Pathc- Class that the result gets mapped torequestEntity- Request body- Returns:
- Response of Type T
-
put
public com.sun.jersey.api.client.ClientResponse put(String path, String mediaType, Object requestEntity) 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 Pathc- 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
-