Interface HttpClient

    • Method Detail

      • 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, use executePost(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