Class Request
- java.lang.Object
-
- org.apache.hc.client5.http.fluent.Request
-
public class Request extends java.lang.ObjectHTTP request used by the fluent facade.- Since:
- 4.2
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.hc.core5.util.TimeoutconnectTimeoutstatic java.lang.StringDATE_FORMATDeprecated.This attribute is no longer supported as a part of the public API.static java.util.LocaleDATE_LOCALEDeprecated.This attribute is no longer supported as a part of the public API.private org.apache.hc.core5.http.HttpHostproxyprivate org.apache.hc.core5.http.ClassicHttpRequestrequestprivate org.apache.hc.core5.util.TimeoutresponseTimeoutstatic java.util.TimeZoneTIME_ZONEDeprecated.This attribute is no longer supported as a part of the public API.private java.lang.BooleanuseExpectContinue
-
Constructor Summary
Constructors Constructor Description Request(org.apache.hc.core5.http.ClassicHttpRequest request)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RequestaddHeader(java.lang.String name, java.lang.String value)RequestaddHeader(org.apache.hc.core5.http.Header header)Requestbody(org.apache.hc.core5.http.HttpEntity entity)RequestbodyByteArray(byte[] b)RequestbodyByteArray(byte[] b, int off, int len)RequestbodyByteArray(byte[] b, int off, int len, org.apache.hc.core5.http.ContentType contentType)RequestbodyByteArray(byte[] b, org.apache.hc.core5.http.ContentType contentType)RequestbodyFile(java.io.File file, org.apache.hc.core5.http.ContentType contentType)RequestbodyForm(java.lang.Iterable<? extends org.apache.hc.core5.http.NameValuePair> formParams)RequestbodyForm(java.lang.Iterable<? extends org.apache.hc.core5.http.NameValuePair> formParams, java.nio.charset.Charset charset)RequestbodyForm(org.apache.hc.core5.http.NameValuePair... formParams)RequestbodyStream(java.io.InputStream inStream)RequestbodyStream(java.io.InputStream inStream, org.apache.hc.core5.http.ContentType contentType)RequestbodyString(java.lang.String s, org.apache.hc.core5.http.ContentType contentType)RequestconnectTimeout(org.apache.hc.core5.util.Timeout timeout)static Requestcreate(java.lang.String methodName, java.lang.String uri)static Requestcreate(java.lang.String methodName, java.net.URI uri)static Requestcreate(org.apache.hc.core5.http.Method method, java.net.URI uri)static Requestdelete(java.lang.String uri)static Requestdelete(java.net.URI uri)Responseexecute()Responseexecute(CloseableHttpClient client)static Requestget(java.lang.String uri)static Requestget(java.net.URI uri)(package private) org.apache.hc.core5.http.ClassicHttpRequestgetRequest()static Requesthead(java.lang.String uri)static Requesthead(java.net.URI uri)(package private) org.apache.hc.core5.http.ClassicHttpResponseinternalExecute(CloseableHttpClient client, HttpClientContext localContext)static Requestoptions(java.lang.String uri)static Requestoptions(java.net.URI uri)static Requestpatch(java.lang.String uri)static Requestpatch(java.net.URI uri)static Requestpost(java.lang.String uri)static Requestpost(java.net.URI uri)static Requestput(java.lang.String uri)static Requestput(java.net.URI uri)RequestremoveHeader(org.apache.hc.core5.http.Header header)RequestremoveHeaders(java.lang.String name)RequestresponseTimeout(org.apache.hc.core5.util.Timeout timeout)RequestsetCacheControl(java.lang.String cacheControl)RequestsetDate(java.time.Instant instant)RequestsetDate(java.util.Date date)Deprecated.UsesetDate(Instant)RequestsetHeader(java.lang.String name, java.lang.String value)RequestsetHeader(org.apache.hc.core5.http.Header header)RequestsetHeaders(org.apache.hc.core5.http.Header... headers)RequestsetIfModifiedSince(java.time.Instant instant)RequestsetIfModifiedSince(java.util.Date date)Deprecated.RequestsetIfUnmodifiedSince(java.time.Instant instant)RequestsetIfUnmodifiedSince(java.util.Date date)Deprecated.java.lang.StringtoString()static Requesttrace(java.lang.String uri)static Requesttrace(java.net.URI uri)RequestuseExpectContinue()RequestuserAgent(java.lang.String agent)Requestversion(org.apache.hc.core5.http.HttpVersion version)RequestviaProxy(java.lang.String proxy)RequestviaProxy(org.apache.hc.core5.http.HttpHost proxy)
-
-
-
Field Detail
-
DATE_FORMAT
@Deprecated public static final java.lang.String DATE_FORMAT
Deprecated.This attribute is no longer supported as a part of the public API.- See Also:
- Constant Field Values
-
DATE_LOCALE
@Deprecated public static final java.util.Locale DATE_LOCALE
Deprecated.This attribute is no longer supported as a part of the public API.
-
TIME_ZONE
@Deprecated public static final java.util.TimeZone TIME_ZONE
Deprecated.This attribute is no longer supported as a part of the public API.
-
request
private final org.apache.hc.core5.http.ClassicHttpRequest request
-
useExpectContinue
private java.lang.Boolean useExpectContinue
-
connectTimeout
private org.apache.hc.core5.util.Timeout connectTimeout
-
responseTimeout
private org.apache.hc.core5.util.Timeout responseTimeout
-
proxy
private org.apache.hc.core5.http.HttpHost proxy
-
-
Method Detail
-
create
public static Request create(org.apache.hc.core5.http.Method method, java.net.URI uri)
-
create
public static Request create(java.lang.String methodName, java.lang.String uri)
-
create
public static Request create(java.lang.String methodName, java.net.URI uri)
-
get
public static Request get(java.net.URI uri)
-
get
public static Request get(java.lang.String uri)
-
head
public static Request head(java.net.URI uri)
-
head
public static Request head(java.lang.String uri)
-
post
public static Request post(java.net.URI uri)
-
post
public static Request post(java.lang.String uri)
-
patch
public static Request patch(java.net.URI uri)
-
patch
public static Request patch(java.lang.String uri)
-
put
public static Request put(java.net.URI uri)
-
put
public static Request put(java.lang.String uri)
-
trace
public static Request trace(java.net.URI uri)
-
trace
public static Request trace(java.lang.String uri)
-
delete
public static Request delete(java.net.URI uri)
-
delete
public static Request delete(java.lang.String uri)
-
options
public static Request options(java.net.URI uri)
-
options
public static Request options(java.lang.String uri)
-
internalExecute
org.apache.hc.core5.http.ClassicHttpResponse internalExecute(CloseableHttpClient client, HttpClientContext localContext) throws java.io.IOException
- Throws:
java.io.IOException
-
execute
public Response execute() throws java.io.IOException
- Throws:
java.io.IOException
-
execute
public Response execute(CloseableHttpClient client) throws java.io.IOException
- Throws:
java.io.IOException
-
addHeader
public Request addHeader(org.apache.hc.core5.http.Header header)
-
setHeader
public Request setHeader(org.apache.hc.core5.http.Header header)
- Since:
- 4.3
-
addHeader
public Request addHeader(java.lang.String name, java.lang.String value)
-
setHeader
public Request setHeader(java.lang.String name, java.lang.String value)
- Since:
- 4.3
-
removeHeader
public Request removeHeader(org.apache.hc.core5.http.Header header)
-
removeHeaders
public Request removeHeaders(java.lang.String name)
-
setHeaders
public Request setHeaders(org.apache.hc.core5.http.Header... headers)
-
setCacheControl
public Request setCacheControl(java.lang.String cacheControl)
-
getRequest
org.apache.hc.core5.http.ClassicHttpRequest getRequest()
-
setDate
@Deprecated public Request setDate(java.util.Date date)
Deprecated.UsesetDate(Instant)
-
setIfModifiedSince
@Deprecated public Request setIfModifiedSince(java.util.Date date)
Deprecated.
-
setIfUnmodifiedSince
@Deprecated public Request setIfUnmodifiedSince(java.util.Date date)
Deprecated.
-
setDate
public Request setDate(java.time.Instant instant)
-
setIfModifiedSince
public Request setIfModifiedSince(java.time.Instant instant)
-
setIfUnmodifiedSince
public Request setIfUnmodifiedSince(java.time.Instant instant)
-
version
public Request version(org.apache.hc.core5.http.HttpVersion version)
-
useExpectContinue
public Request useExpectContinue()
-
userAgent
public Request userAgent(java.lang.String agent)
-
connectTimeout
public Request connectTimeout(org.apache.hc.core5.util.Timeout timeout)
-
responseTimeout
public Request responseTimeout(org.apache.hc.core5.util.Timeout timeout)
-
viaProxy
public Request viaProxy(org.apache.hc.core5.http.HttpHost proxy)
-
viaProxy
public Request viaProxy(java.lang.String proxy)
- Since:
- 4.4
-
body
public Request body(org.apache.hc.core5.http.HttpEntity entity)
-
bodyForm
public Request bodyForm(java.lang.Iterable<? extends org.apache.hc.core5.http.NameValuePair> formParams, java.nio.charset.Charset charset)
-
bodyForm
public Request bodyForm(java.lang.Iterable<? extends org.apache.hc.core5.http.NameValuePair> formParams)
-
bodyForm
public Request bodyForm(org.apache.hc.core5.http.NameValuePair... formParams)
-
bodyString
public Request bodyString(java.lang.String s, org.apache.hc.core5.http.ContentType contentType)
-
bodyFile
public Request bodyFile(java.io.File file, org.apache.hc.core5.http.ContentType contentType)
-
bodyByteArray
public Request bodyByteArray(byte[] b)
-
bodyByteArray
public Request bodyByteArray(byte[] b, org.apache.hc.core5.http.ContentType contentType)
- Since:
- 4.4
-
bodyByteArray
public Request bodyByteArray(byte[] b, int off, int len)
-
bodyByteArray
public Request bodyByteArray(byte[] b, int off, int len, org.apache.hc.core5.http.ContentType contentType)
- Since:
- 4.4
-
bodyStream
public Request bodyStream(java.io.InputStream inStream)
-
bodyStream
public Request bodyStream(java.io.InputStream inStream, org.apache.hc.core5.http.ContentType contentType)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-