Android Client SDK
com.verivo.akula.http.AKHttpRequestData Class Reference

The AKHttpRequestData class encapsulating data to be sent in an HTTP request. More...

Public Member Functions

void addHeader (Header header)
 Add a header to be sent with an HTTP request. More...
 
void addHeader (String name, String value)
 Add a header to be sent with an HTTP request as a name/value pair. More...
 
void addQueryParameter (NameValuePair param)
 Add a new query parameter to be sent with an HTTP request. More...
 
void addQueryParameter (String name, String value)
 Add a new basic query parameter as a name/value pair. More...
 
void clearHeaders ()
 Remove all headers from an HTTP request. More...
 
void clearQueryParameters ()
 Remove all query parameters from an HTTP request. More...
 
AKHttpBody getBodyData ()
 Get the data to be sent in the HTTP request body. More...
 
HttpEntity getBodyEntity ()
 Get the body data as an HttpEntity object. More...
 
List< Header > getHeaders ()
 Get the request headers. More...
 
Header[] getHeadersAsArray ()
 Get the request headers as an Array. More...
 
List< NameValuePair > getQueryParameters ()
 Get the query parameters. More...
 
String getQueryParametersAsString ()
 Get the query parameters as a string. More...
 
void mergeRequestData (AKHttpRequestData newData)
 Merge the data from another AKHttpRequestData object into this one. More...
 
void removeHeader (Header header)
 Remove a header from an HTTP request. More...
 
void removeQueryParameter (NameValuePair param)
 Remove a query parameter from an HTTP request. More...
 
void setBodyData (AKHttpBody bodyData)
 Set the data to be sent in the HTTP request body. More...
 
void setHeaders (List< Header > headers)
 Set the list of headers to be sent in the HTTP request. More...
 
void setQueryParameters (List< NameValuePair > params)
 Set the list of query parameters to be appended to the URL of the HTTP request. More...
 

Detailed Description

The AKHttpRequestData class encapsulating data to be sent in an HTTP request.

This data includes headers, query parameters, and body data.

On creation, the AKHttpAgent class defines an instance of the AKHttpRequestData class. Request data set on AKHttpAgent is then used by any AKServerAgent request method.

See Also
AKHttpAgent

Member Function Documentation

void com.verivo.akula.http.AKHttpRequestData.addHeader ( Header  header)

Add a header to be sent with an HTTP request.

Parameters
headerA Header object representing the new header.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.addHeader ( String  name,
String  value 
)

Add a header to be sent with an HTTP request as a name/value pair.

Parameters
nameThe header name.
valueThe header value.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.addQueryParameter ( NameValuePair  param)

Add a new query parameter to be sent with an HTTP request.

Parameters
paramA NameValuePair object representing the query parameter.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.addQueryParameter ( String  name,
String  value 
)

Add a new basic query parameter as a name/value pair.

Parameters
nameThe name of the query parameter.
valueThe value of the query parameter
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.clearHeaders ( )

Remove all headers from an HTTP request.

Version
1.0
void com.verivo.akula.http.AKHttpRequestData.clearQueryParameters ( )

Remove all query parameters from an HTTP request.

Version
1.0
AKHttpBody com.verivo.akula.http.AKHttpRequestData.getBodyData ( )

Get the data to be sent in the HTTP request body.

Returns
The data to be sent in the HTTP request body as an AKHttpBody object.
Version
1.0
HttpEntity com.verivo.akula.http.AKHttpRequestData.getBodyEntity ( )

Get the body data as an HttpEntity object.

Returns
The body data as an HttpEntity object.
Version
1.0
List<Header> com.verivo.akula.http.AKHttpRequestData.getHeaders ( )

Get the request headers.

Returns
The headers to be sent in the HTTP request as a List object.
Version
1.0
Header [] com.verivo.akula.http.AKHttpRequestData.getHeadersAsArray ( )

Get the request headers as an Array.

Returns
The list of headers as an array.
Version
1.0
List<NameValuePair> com.verivo.akula.http.AKHttpRequestData.getQueryParameters ( )

Get the query parameters.

Returns
The query parameters as a List object.
Version
1.0
String com.verivo.akula.http.AKHttpRequestData.getQueryParametersAsString ( )

Get the query parameters as a string.

Returns
The query parameters as a string, properly encoded and UTF-8-formatted.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.mergeRequestData ( AKHttpRequestData  newData)

Merge the data from another AKHttpRequestData object into this one.

Headers and query parameters from both AKHttpRequestData objects are merged. If there is a conflict, the headers and query parameters from newData are retained. If newData contains any body data, it overwrites the body data of this AKHttpRequestData object.

Parameters
newDataAKHttpRequestData to merge.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.removeHeader ( Header  header)

Remove a header from an HTTP request.

Parameters
headerA Header object representing the header to remove.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.removeQueryParameter ( NameValuePair  param)

Remove a query parameter from an HTTP request.

Parameters
paramA NameValuePair object representing the query parameter to remove.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.setBodyData ( AKHttpBody  bodyData)

Set the data to be sent in the HTTP request body.

Parameters
bodyDataThe request data as an AKHttpBoby object.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.setHeaders ( List< Header >  headers)

Set the list of headers to be sent in the HTTP request.

Parameters
headersThe headers as a List object.
Version
1.0
void com.verivo.akula.http.AKHttpRequestData.setQueryParameters ( List< NameValuePair >  params)

Set the list of query parameters to be appended to the URL of the HTTP request.

Parameters
paramsThe query params as a List object.
Version
1.0