com.ning.http.client
Interface Request


public interface Request

The Request class can be used to construct HTTP request:

   Request r = new RequestBuilder().setUrl("url")
                      .setRealm((new Realm.RealmBuilder()).setPrincipal(user)
                      .setPassword(admin)
                      .setRealmName("MyRealm")
                      .setScheme(Realm.AuthScheme.DIGEST).build());
   r.execute();
 


Nested Class Summary
static interface Request.EntityWriter
          An entity that can be used to manipulate the Request's body output before it get sent.
 
Method Summary
 String getBodyEncoding()
          Return the encoding value used when encoding the request's body.
 BodyGenerator getBodyGenerator()
          Return the current request's body generator.
 byte[] getByteData()
          Return the current request's body as a byte array
 long getContentLength()
          Return the current size of the content-lenght header based on the body's size.
 Collection<Cookie> getCookies()
          Return Coookie.
 Request.EntityWriter getEntityWriter()
          Return the current request's body as an EntityWriter
 File getFile()
          Return the File to upload.
 FluentCaseInsensitiveStringsMap getHeaders()
          Return the current set of Headers.
 long getLength()
          Deprecated.  
 String getMethod()
          Return the request's method name (GET, POST, etc.)
 FluentStringsMap getParams()
          Return the current parameters.
 List<Part> getParts()
          Return the current Part
 PerRequestConfig getPerRequestConfig()
          Return Per request configuration.
 ProxyServer getProxyServer()
          Return the ProxyServer
 FluentStringsMap getQueryParams()
          Return the query params.
 long getRangeOffset()
          Return the HTTP Range header value, or
 String getRawUrl()
          Return the undecoded url
 Realm getRealm()
          Return the Realm
 String getReqType()
          Deprecated. - use getMethod
 InputStream getStreamData()
          Return the current request's body as an InputStream
 String getStringData()
          Return the current request's body as a string
 String getUrl()
          Return the decoded url
 String getVirtualHost()
          Return the virtual host value.
 boolean isRedirectEnabled()
          Return the true> to follow redirect
 boolean isUseRawUrl()
           
 

Method Detail

getReqType

String getReqType()
Deprecated. - use getMethod

Return the request's type (GET, POST, etc.)

Returns:
the request's type (GET, POST, etc.)

getMethod

String getMethod()
Return the request's method name (GET, POST, etc.)

Returns:
the request's method name (GET, POST, etc.)

getUrl

String getUrl()
Return the decoded url

Returns:
the decoded url

getRawUrl

String getRawUrl()
Return the undecoded url

Returns:
the undecoded url

getHeaders

FluentCaseInsensitiveStringsMap getHeaders()
Return the current set of Headers.

Returns:
a FluentCaseInsensitiveStringsMap contains headers.

getCookies

Collection<Cookie> getCookies()
Return Coookie.

Returns:
an unmodifiable Collection of Cookies

getByteData

byte[] getByteData()
Return the current request's body as a byte array

Returns:
a byte array of the current request's body.

getStringData

String getStringData()
Return the current request's body as a string

Returns:
an String representation of the current request's body.

getStreamData

InputStream getStreamData()
Return the current request's body as an InputStream

Returns:
an InputStream representation of the current request's body.

getEntityWriter

Request.EntityWriter getEntityWriter()
Return the current request's body as an EntityWriter

Returns:
an EntityWriter representation of the current request's body.

getBodyGenerator

BodyGenerator getBodyGenerator()
Return the current request's body generator.

Returns:
A generator for the request body.

getLength

long getLength()
Deprecated. 

Return the current size of the content-lenght header based on the body's size.

Returns:
the current size of the content-lenght header based on the body's size.

getContentLength

long getContentLength()
Return the current size of the content-lenght header based on the body's size.

Returns:
the current size of the content-lenght header based on the body's size.

getParams

FluentStringsMap getParams()
Return the current parameters.

Returns:
a FluentStringsMap of parameters.

getParts

List<Part> getParts()
Return the current Part

Returns:
the current Part

getVirtualHost

String getVirtualHost()
Return the virtual host value.

Returns:
the virtual host value.

getQueryParams

FluentStringsMap getQueryParams()
Return the query params.

Returns:
FluentStringsMap of query string

getProxyServer

ProxyServer getProxyServer()
Return the ProxyServer

Returns:
the ProxyServer

getRealm

Realm getRealm()
Return the Realm

Returns:
the Realm

getFile

File getFile()
Return the File to upload.

Returns:
the File to upload.

isRedirectEnabled

boolean isRedirectEnabled()
Return the true> to follow redirect

Returns:
the true> to follow redirect

getPerRequestConfig

PerRequestConfig getPerRequestConfig()
Return Per request configuration.

Returns:
Per request configuration.

getRangeOffset

long getRangeOffset()
Return the HTTP Range header value, or

Returns:
the range header value, or 0 is not set.

getBodyEncoding

String getBodyEncoding()
Return the encoding value used when encoding the request's body.

Returns:
the encoding value used when encoding the request's body.

isUseRawUrl

boolean isUseRawUrl()


Copyright © 2011. All Rights Reserved.