Interface HttpClient
- All Known Implementing Classes:
ArcgisRestHttpClient, SimpleHttpClient
public interface HttpClient
-
Method Summary
Modifier and TypeMethodDescriptionexecute(String url, AbstractRequest request) execute(URI url, AbstractRequest request) org.apache.hc.core5.http.ClassicHttpResponseexecuteGet(String uri) org.apache.hc.core5.http.ClassicHttpResponseexecuteMethod(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase method) org.apache.hc.core5.http.ClassicHttpResponseexecutePost(String uri, String payloadToSend) Sends the given payload as content-type text/xml with UTF-8 encoding to the determined URI.org.apache.hc.core5.http.ClassicHttpResponseexecutePost(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.hc.core5.http.ClassicHttpResponseexecutePost(String uri, org.apache.hc.core5.http.HttpEntity payloadToSend) Sends the given payload to the determined URI.
-
Method Details
-
executeGet
- Throws:
IOException
-
executePost
org.apache.hc.core5.http.ClassicHttpResponse 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.hc.core5.http.ClassicHttpResponse 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.hc.core5.http.ClassicHttpResponse executePost(String uri, org.apache.hc.core5.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.hc.core5.http.ClassicHttpResponse executeMethod(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase 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
- Throws:
ProxyHttpClientException
-
execute
- Throws:
ProxyHttpClientException
-