Class SimpleHttpRequest

java.lang.Object
org.apache.hc.core5.http.message.HeaderGroup
org.apache.hc.core5.http.message.BasicHttpRequest
org.apache.hc.client5.http.async.methods.ConfigurableHttpRequest
org.apache.hc.client5.http.async.methods.SimpleHttpRequest
All Implemented Interfaces:
Serializable, Configurable, org.apache.hc.core5.http.HttpMessage, org.apache.hc.core5.http.HttpRequest, org.apache.hc.core5.http.MessageHeaders

public final class SimpleHttpRequest extends ConfigurableHttpRequest
HTTP request that can enclose a body represented as a simple text string or an array of bytes.

IMPORTANT: SimpleHttpRequests are intended for simple scenarios where entities inclosed in requests are known to be small. It is generally recommended to use AsyncRequestBuilder and streaming AsyncEntityProducers.

Since:
5.0
See Also:
  • Field Details

  • Constructor Details

    • SimpleHttpRequest

      public SimpleHttpRequest(String method, String path)
    • SimpleHttpRequest

      public SimpleHttpRequest(String method, org.apache.hc.core5.http.HttpHost host, String path)
    • SimpleHttpRequest

      public SimpleHttpRequest(String method, URI requestUri)
    • SimpleHttpRequest

      public SimpleHttpRequest(org.apache.hc.core5.http.Method method, URI requestUri)
      Since:
      5.1
    • SimpleHttpRequest

      public SimpleHttpRequest(org.apache.hc.core5.http.Method method, org.apache.hc.core5.http.HttpHost host, String path)
      Since:
      5.1
    • SimpleHttpRequest

      public SimpleHttpRequest(String method, String scheme, org.apache.hc.core5.net.URIAuthority authority, String path)
      Since:
      5.1
  • Method Details

    • create

      public static SimpleHttpRequest create(String method, String uri)
      Since:
      5.1
    • create

      public static SimpleHttpRequest create(String method, URI uri)
      Since:
      5.1
    • create

      public static SimpleHttpRequest create(org.apache.hc.core5.http.Method method, URI uri)
      Since:
      5.1
    • create

      public static SimpleHttpRequest create(org.apache.hc.core5.http.Method method, org.apache.hc.core5.http.HttpHost host, String path)
      Since:
      5.1
    • create

      public static SimpleHttpRequest create(String method, String scheme, org.apache.hc.core5.net.URIAuthority authority, String path)
      Since:
      5.1
    • copy

      @Deprecated public static SimpleHttpRequest copy(org.apache.hc.core5.http.HttpRequest original)
      Deprecated.
    • setBody

      public void setBody(SimpleBody body)
    • setBody

      public void setBody(byte[] bodyBytes, org.apache.hc.core5.http.ContentType contentType)
    • setBody

      public void setBody(String bodyText, org.apache.hc.core5.http.ContentType contentType)
    • getBody

      public SimpleBody getBody()
    • getContentType

      public org.apache.hc.core5.http.ContentType getContentType()
    • getBodyText

      public String getBodyText()
    • getBodyBytes

      public byte[] getBodyBytes()