org.apache.http.client.fluent
Class Request

java.lang.Object
  extended by org.apache.http.client.fluent.Request

public class Request
extends Object


Field Summary
static String DATE_FORMAT
           
static Locale DATE_LOCALE
           
static TimeZone TIME_ZONE
           
 
Method Summary
 void abort()
           
 Request addHeader(Header header)
           
 Request addHeader(String name, String value)
           
 Request body(HttpEntity entity)
           
 Request bodyByteArray(byte[] b)
           
 Request bodyByteArray(byte[] b, ContentType contentType)
           
 Request bodyByteArray(byte[] b, int off, int len)
           
 Request bodyByteArray(byte[] b, int off, int len, ContentType contentType)
           
 Request bodyFile(File file, ContentType contentType)
           
 Request bodyForm(Iterable<? extends NameValuePair> formParams)
           
 Request bodyForm(Iterable<? extends NameValuePair> formParams, Charset charset)
           
 Request bodyForm(NameValuePair... formParams)
           
 Request bodyStream(InputStream instream)
           
 Request bodyStream(InputStream instream, ContentType contentType)
           
 Request bodyString(String s, ContentType contentType)
           
 Request config(String param, Object object)
          Deprecated. (4.3)
 Request connectTimeout(int timeout)
           
static Request Delete(String uri)
           
static Request Delete(URI uri)
           
 Request elementCharset(String charset)
          Deprecated. (4.3)
 Response execute()
           
static Request Get(String uri)
           
static Request Get(URI uri)
           
static Request Head(String uri)
           
static Request Head(URI uri)
           
static Request Options(String uri)
           
static Request Options(URI uri)
           
static Request Patch(String uri)
           
static Request Patch(URI uri)
           
static Request Post(String uri)
           
static Request Post(URI uri)
           
static Request Put(String uri)
           
static Request Put(URI uri)
           
 Request removeConfig(String param)
          Deprecated. (4.3)
 Request removeHeader(Header header)
           
 Request removeHeaders(String name)
           
 Request setCacheControl(String cacheControl)
           
 Request setDate(Date date)
           
 Request setHeader(Header header)
           
 Request setHeader(String name, String value)
           
 Request setHeaders(Header... headers)
           
 Request setIfModifiedSince(Date date)
           
 Request setIfUnmodifiedSince(Date date)
           
 Request socketTimeout(int timeout)
           
 Request staleConnectionCheck(boolean b)
          Deprecated. (4.4)
 String toString()
           
static Request Trace(String uri)
           
static Request Trace(URI uri)
           
 Request useExpectContinue()
           
 Request userAgent(String agent)
           
 Request version(HttpVersion version)
           
 Request viaProxy(HttpHost proxy)
           
 Request viaProxy(String proxy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATE_FORMAT

public static final String DATE_FORMAT
See Also:
Constant Field Values

DATE_LOCALE

public static final Locale DATE_LOCALE

TIME_ZONE

public static final TimeZone TIME_ZONE
Method Detail

Get

public static Request Get(URI uri)

Get

public static Request Get(String uri)

Head

public static Request Head(URI uri)

Head

public static Request Head(String uri)

Post

public static Request Post(URI uri)

Post

public static Request Post(String uri)

Patch

public static Request Patch(URI uri)

Patch

public static Request Patch(String uri)

Put

public static Request Put(URI uri)

Put

public static Request Put(String uri)

Trace

public static Request Trace(URI uri)

Trace

public static Request Trace(String uri)

Delete

public static Request Delete(URI uri)

Delete

public static Request Delete(String uri)

Options

public static Request Options(URI uri)

Options

public static Request Options(String uri)

execute

public Response execute()
                 throws ClientProtocolException,
                        IOException
Throws:
ClientProtocolException
IOException

abort

public void abort()
           throws UnsupportedOperationException
Throws:
UnsupportedOperationException

addHeader

public Request addHeader(Header header)

setHeader

public Request setHeader(Header header)
Since:
4.3

addHeader

public Request addHeader(String name,
                         String value)

setHeader

public Request setHeader(String name,
                         String value)
Since:
4.3

removeHeader

public Request removeHeader(Header header)

removeHeaders

public Request removeHeaders(String name)

setHeaders

public Request setHeaders(Header... headers)

setCacheControl

public Request setCacheControl(String cacheControl)

setDate

public Request setDate(Date date)

setIfModifiedSince

public Request setIfModifiedSince(Date date)

setIfUnmodifiedSince

public Request setIfUnmodifiedSince(Date date)

config

@Deprecated
public Request config(String param,
                                 Object object)
Deprecated. (4.3)

This method has no effect. Do not use.


removeConfig

@Deprecated
public Request removeConfig(String param)
Deprecated. (4.3)

This method has no effect. Do not use.


version

public Request version(HttpVersion version)

elementCharset

@Deprecated
public Request elementCharset(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(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(HttpHost proxy)

viaProxy

public Request viaProxy(String proxy)
Since:
4.4

body

public Request body(HttpEntity entity)

bodyForm

public Request bodyForm(Iterable<? extends NameValuePair> formParams,
                        Charset charset)

bodyForm

public Request bodyForm(Iterable<? extends NameValuePair> formParams)

bodyForm

public Request bodyForm(NameValuePair... formParams)

bodyString

public Request bodyString(String s,
                          ContentType contentType)

bodyFile

public Request bodyFile(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(InputStream instream)

bodyStream

public Request bodyStream(InputStream instream,
                          ContentType contentType)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.