Class Post


public class Post extends HttpRequest
Wrapper to initiate an HTTP POST Request.
Author:
Christian Pesch
  • Constructor Details

  • Method Details

    • addString

      public void addString(String name, String value)
    • setBody

      public void setBody(String body, org.apache.hc.core5.http.ContentType contentType)
      Sends the given string verbatim as the request body (not multipart), so the transmitted bytes are exactly body encoded with the content type's charset. Used where the server expects a raw JSON body it can sign-verify.
    • addFile

      public void addFile(String name, File value)
    • addFile

      public void addFile(String name, byte[] value)
    • throwsSocketExceptionIfUnAuthorized

      protected boolean throwsSocketExceptionIfUnAuthorized()
      Overrides:
      throwsSocketExceptionIfUnAuthorized in class HttpRequest
    • setHeader

      public void setHeader(String name, String value)
      Overrides:
      setHeader in class HttpRequest
    • execute

      public <T> T execute(org.apache.hc.core5.http.io.HttpClientResponseHandler<T> responseHandler) throws IOException
      Overrides:
      execute in class HttpRequest
      Throws:
      IOException
    • getLocation

      public String getLocation() throws IOException
      Throws:
      IOException
    • setAccept

      public void setAccept(String accept)