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
HTTP request that can enclose a body represented as a simple text string or an array of bytes.
IMPORTANT: SimpleHttpRequest
s are intended for simple scenarios where entities inclosed
in requests are known to be small. It is generally recommended to use
AsyncRequestBuilder
and streaming
AsyncEntityProducer
s.
- Since:
- 5.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleHttpRequest
(String method, String path) SimpleHttpRequest
(String method, String scheme, org.apache.hc.core5.net.URIAuthority authority, String path) SimpleHttpRequest
(String method, URI requestUri) SimpleHttpRequest
(String method, org.apache.hc.core5.http.HttpHost host, String path) SimpleHttpRequest
(org.apache.hc.core5.http.Method method, URI requestUri) SimpleHttpRequest
(org.apache.hc.core5.http.Method method, org.apache.hc.core5.http.HttpHost host, String path) -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleHttpRequest
copy
(org.apache.hc.core5.http.HttpRequest original) Deprecated.static SimpleHttpRequest
static SimpleHttpRequest
static SimpleHttpRequest
static SimpleHttpRequest
static SimpleHttpRequest
getBody()
byte[]
org.apache.hc.core5.http.ContentType
void
setBody
(byte[] bodyBytes, org.apache.hc.core5.http.ContentType contentType) void
void
setBody
(SimpleBody body) Methods inherited from class org.apache.hc.client5.http.async.methods.ConfigurableHttpRequest
getConfig, setConfig
Methods inherited from class org.apache.hc.core5.http.message.BasicHttpRequest
addHeader, getAuthority, getMethod, getPath, getRequestUri, getScheme, getUri, getVersion, setAbsoluteRequestUri, setAuthority, setHeader, setPath, setScheme, setUri, setVersion, toString
Methods inherited from class org.apache.hc.core5.http.message.HeaderGroup
addHeader, clear, containsHeader, countHeaders, getCondensedHeader, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator, removeHeader, removeHeaders, removeHeaders, setHeader, setHeaders
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hc.core5.http.HttpMessage
addHeader, removeHeader, removeHeaders, setHeader, setHeaders
Methods inherited from interface org.apache.hc.core5.http.MessageHeaders
containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
body
-
-
Constructor Details
-
SimpleHttpRequest
-
SimpleHttpRequest
-
SimpleHttpRequest
-
SimpleHttpRequest
- 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
- Since:
- 5.1
-
create
- Since:
- 5.1
-
create
- 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. -
setBody
-
setBody
public void setBody(byte[] bodyBytes, org.apache.hc.core5.http.ContentType contentType) -
setBody
-
getBody
-
getContentType
public org.apache.hc.core5.http.ContentType getContentType() -
getBodyText
-
getBodyBytes
public byte[] getBodyBytes()
-
SimpleRequestBuilder