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();
 


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
 ConnectionPoolKeyStrategy getConnectionPoolKeyStrategy()
           
 long getContentLength()
          Return the current size of the content-lenght header based on the body's size.
 Collection<Cookie> getCookies()
          Return Coookie.
 File getFile()
          Return the File to upload.
 Boolean getFollowRedirect()
          Return follow redirect
 List<Param> getFormParams()
          Return the current form parameters.
 FluentCaseInsensitiveStringsMap getHeaders()
          Return the current set of Headers.
 InetAddress getInetAddress()
          Return the InetAddress to override
 InetAddress getLocalAddress()
           
 String getMethod()
          Return the request's method name (GET, POST, etc.)
 List<Part> getParts()
          Return the current Part
 ProxyServer getProxyServer()
          Return the ProxyServer
 List<Param> getQueryParams()
          Return the query params.
 long getRangeOffset()
          Return the HTTP Range header value, or
 Realm getRealm()
          Return the Realm
 int getRequestTimeoutInMs()
          Overrides the config default value
 InputStream getStreamData()
          Return the current request's body as an InputStream
 String getStringData()
          Return the current request's body as a string
 UriComponents getURI()
           
 String getVirtualHost()
          Return the virtual host value.
 

Method Detail

getMethod

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

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

getURI

UriComponents getURI()

getInetAddress

InetAddress getInetAddress()
Return the InetAddress to override

Returns:
the InetAddress

getLocalAddress

InetAddress getLocalAddress()

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.

getBodyGenerator

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

Returns:
A generator for the request body.

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.

getFormParams

List<Param> getFormParams()
Return the current form 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

List<Param> 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.

getFollowRedirect

Boolean getFollowRedirect()
Return follow redirect

Returns:
the TRUE> to follow redirect, FALSE, if NOT to follow, whatever the client config. Return null if not set.

getRequestTimeoutInMs

int getRequestTimeoutInMs()
Overrides the config default value

Returns:
the request timeout

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.

getConnectionPoolKeyStrategy

ConnectionPoolKeyStrategy getConnectionPoolKeyStrategy()


Copyright © 2014. All Rights Reserved.