Interface HttpClient
-
- All Known Implementing Classes:
SimpleHttpClient
public interface HttpClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Responseexecute(String url, AbstractRequest request)Responseexecute(URI url, AbstractRequest request)org.apache.http.HttpResponseexecuteGet(String uri)org.apache.http.HttpResponseexecuteMethod(org.apache.http.client.methods.HttpRequestBase method)org.apache.http.HttpResponseexecutePost(String uri, String payloadToSend)Sends the given payload as content-type text/xml with UTF-8 encoding to the determined URI.org.apache.http.HttpResponseexecutePost(String uri, String payloadToSend, org.n52.janmayen.http.MediaType contentType)Sends the given payload (marked to be of a specific content-type) to the determined URI.org.apache.http.HttpResponseexecutePost(String uri, org.apache.http.HttpEntity payloadToSend)Sends the given payload to the determined URI.
-
-
-
Method Detail
-
executeGet
org.apache.http.HttpResponse executeGet(String uri) throws IOException
- Throws:
IOException
-
executePost
org.apache.http.HttpResponse executePost(String uri, String payloadToSend) throws IOException
Sends the given payload as content-type text/xml with UTF-8 encoding to the determined URI. Callees are responsible for ensuring that the contents are actually encoded as UTF-8. If not UTF-8, useexecutePost(String, String, MediaType)instead.- Parameters:
uri- the target to send the POST request to.payloadToSend- the POST payload as XML encoded as UTF-8.- Returns:
- the HTTP response returned by the target.
- Throws:
IOException- if sending the request fails.
-
executePost
org.apache.http.HttpResponse executePost(String uri, String payloadToSend, org.n52.janmayen.http.MediaType contentType) throws IOException
Sends the given payload (marked to be of a specific content-type) to the determined URI.- Parameters:
uri- the target to send the POST request to.payloadToSend- the POST payload as XML.contentType- the content-type of the payload.- Returns:
- the HTTP response returned by the target.
- Throws:
IOException- if sending the request fails.
-
executePost
org.apache.http.HttpResponse executePost(String uri, org.apache.http.HttpEntity payloadToSend) throws IOException
Sends the given payload to the determined URI. Refer to the HTTP components docs to get more information which entity types are possible.- Parameters:
uri- the target to send the POST request to.payloadToSend- a more generic way to send arbitrary content.- Returns:
- the HTTP response returned by the target.
- Throws:
IOException- if sending the request fails.
-
executeMethod
org.apache.http.HttpResponse executeMethod(org.apache.http.client.methods.HttpRequestBase method) throws IOException- Parameters:
method- the HTTP method to execute.- Returns:
- the HTTP response returned by the target.
- Throws:
IOException- if sending the request fails
-
execute
Response execute(URI url, AbstractRequest request) throws ProxyException
- Throws:
ProxyException
-
execute
Response execute(String url, AbstractRequest request) throws ProxyException
- Throws:
ProxyException
-
-