Package org.apache.http.client.fluent
Class Request
- java.lang.Object
-
- org.apache.http.client.fluent.Request
-
public class Request extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DATE_FORMAT
static java.util.Locale
DATE_LOCALE
static java.util.TimeZone
TIME_ZONE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
abort()
Request
addHeader(java.lang.String name, java.lang.String value)
Request
addHeader(Header header)
Request
body(HttpEntity entity)
Request
bodyByteArray(byte[] b)
Request
bodyByteArray(byte[] b, int off, int len)
Request
bodyByteArray(byte[] b, int off, int len, ContentType contentType)
Request
bodyByteArray(byte[] b, ContentType contentType)
Request
bodyFile(java.io.File file, ContentType contentType)
Request
bodyForm(java.lang.Iterable<? extends NameValuePair> formParams)
Request
bodyForm(java.lang.Iterable<? extends NameValuePair> formParams, java.nio.charset.Charset charset)
Request
bodyForm(NameValuePair... formParams)
Request
bodyStream(java.io.InputStream inStream)
Request
bodyStream(java.io.InputStream inStream, ContentType contentType)
Request
bodyString(java.lang.String s, ContentType contentType)
Request
config(java.lang.String param, java.lang.Object object)
Deprecated.(4.3)Request
connectTimeout(int timeout)
static Request
Delete(java.lang.String uri)
static Request
Delete(java.net.URI uri)
Request
elementCharset(java.lang.String charset)
Deprecated.(4.3)Response
execute()
static Request
Get(java.lang.String uri)
static Request
Get(java.net.URI uri)
static Request
Head(java.lang.String uri)
static Request
Head(java.net.URI uri)
static Request
Options(java.lang.String uri)
static Request
Options(java.net.URI uri)
static Request
Patch(java.lang.String uri)
static Request
Patch(java.net.URI uri)
static Request
Post(java.lang.String uri)
static Request
Post(java.net.URI uri)
static Request
Put(java.lang.String uri)
static Request
Put(java.net.URI uri)
Request
removeConfig(java.lang.String param)
Deprecated.(4.3)Request
removeHeader(Header header)
Request
removeHeaders(java.lang.String name)
Request
setCacheControl(java.lang.String cacheControl)
Request
setDate(java.util.Date date)
Request
setHeader(java.lang.String name, java.lang.String value)
Request
setHeader(Header header)
Request
setHeaders(Header... headers)
Request
setIfModifiedSince(java.util.Date date)
Request
setIfUnmodifiedSince(java.util.Date date)
Request
socketTimeout(int timeout)
Request
staleConnectionCheck(boolean b)
Deprecated.(4.4)java.lang.String
toString()
static Request
Trace(java.lang.String uri)
static Request
Trace(java.net.URI uri)
Request
useExpectContinue()
Request
userAgent(java.lang.String agent)
Request
version(HttpVersion version)
Request
viaProxy(java.lang.String proxy)
Request
viaProxy(HttpHost proxy)
-
-
-
Field Detail
-
DATE_FORMAT
public static final java.lang.String DATE_FORMAT
- See Also:
- Constant Field Values
-
DATE_LOCALE
public static final java.util.Locale DATE_LOCALE
-
TIME_ZONE
public static final java.util.TimeZone TIME_ZONE
-
-
Method Detail
-
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)
-
execute
public Response execute() throws ClientProtocolException, java.io.IOException
- Throws:
ClientProtocolException
java.io.IOException
-
abort
public void abort() throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
-
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
-
removeHeaders
public Request removeHeaders(java.lang.String name)
-
setCacheControl
public Request setCacheControl(java.lang.String cacheControl)
-
setDate
public Request setDate(java.util.Date date)
-
setIfModifiedSince
public Request setIfModifiedSince(java.util.Date date)
-
setIfUnmodifiedSince
public Request setIfUnmodifiedSince(java.util.Date date)
-
config
@Deprecated public Request config(java.lang.String param, java.lang.Object object)
Deprecated.(4.3)This method has no effect. Do not use.
-
removeConfig
@Deprecated public Request removeConfig(java.lang.String param)
Deprecated.(4.3)This method has no effect. Do not use.
-
version
public Request version(HttpVersion version)
-
elementCharset
@Deprecated public Request elementCharset(java.lang.String charset)
Deprecated.(4.3)This parameter can no longer be used at the request level.This method has no effect. Do not use.
-
useExpectContinue
public Request useExpectContinue()
-
userAgent
public Request userAgent(java.lang.String agent)
-
socketTimeout
public Request socketTimeout(int timeout)
-
connectTimeout
public Request connectTimeout(int timeout)
-
staleConnectionCheck
@Deprecated public Request staleConnectionCheck(boolean b)
Deprecated.(4.4)This method has no effect. Do not use.
-
viaProxy
public Request viaProxy(java.lang.String proxy)
- Since:
- 4.4
-
body
public Request body(HttpEntity entity)
-
bodyForm
public Request bodyForm(java.lang.Iterable<? extends NameValuePair> formParams, java.nio.charset.Charset charset)
-
bodyForm
public Request bodyForm(java.lang.Iterable<? extends NameValuePair> formParams)
-
bodyForm
public Request bodyForm(NameValuePair... formParams)
-
bodyString
public Request bodyString(java.lang.String s, ContentType contentType)
-
bodyFile
public Request bodyFile(java.io.File file, ContentType contentType)
-
bodyByteArray
public Request bodyByteArray(byte[] b)
-
bodyByteArray
public Request bodyByteArray(byte[] b, 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, ContentType contentType)
- Since:
- 4.4
-
bodyStream
public Request bodyStream(java.io.InputStream inStream)
-
bodyStream
public Request bodyStream(java.io.InputStream inStream, ContentType contentType)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-