IOS Client SDK
AKHTTPRequestData Class Reference

The AKHTTPRequestData class contains headers, query parameters, and post data to be sent in an HTTP request. More...

#import <AKHTTPRequestData.h>

Inheritance diagram for AKHTTPRequestData:
Inheritance graph

Instance Methods

(void) - addHeadersFromDictionary:
 Adds or changes header values for each dictionary entry. More...
 
(void) - addQueryParamsFromDictionary:
 Adds or changes query parameter values for each dictionary entry. More...
 
(NSString *) - headerValueForKey:
 Gets the value of a specified header. More...
 
(NSString *) - queryParamValueForKey:
 Gets the value of a specified query parameter. More...
 
(void) - removeAllHeaders
 Deletes all header key-value pairs. More...
 
(void) - removeAllQueryParams
 Deletes all query parameter key-value pairs. More...
 
(void) - removeHeaderForKey:
 Removes the header that matches key from the dictionary of headers. More...
 
(void) - removeQueryParamForKey:
 Removes the query parameter that matches key from the dictionary of query parameters. More...
 
(void) - setHeaderValue:forKey:
 Adds or changes an existing header value. More...
 
(void) - setQueryParamValue:forKey:
 Adds or changes an existing query parameter value. More...
 

Properties

AKHTTPBodybodyData
 Data to set in the HTTP request's post data. More...
 
NSData * data
 Raw data to set in the HTTP request's post data. More...
 
NSDictionary * headers
 Name value pairs to set in the HTTP request's header. More...
 
NSDictionary * queryParams
 Name value pairs to append to the URL's query string. More...
 

Detailed Description

The AKHTTPRequestData class contains headers, query parameters, and post data to be sent in an HTTP request.

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
Version
1.0

Method Documentation

- (void) addHeadersFromDictionary: (NSDictionary *)  headers

Adds or changes header values for each dictionary entry.

Parameters
headerskey-value pairs to add as header values.
Version
1.0
- (void) addQueryParamsFromDictionary: (NSDictionary *)  queryParams

Adds or changes query parameter values for each dictionary entry.

Parameters
queryParamsKey-value pairs to add as query parameter values.
Version
1.0
- (NSString *) headerValueForKey: (NSString *)  key

Gets the value of a specified header.

Parameters
keyThe name of the header to get the value for. Cannot be nil.
Returns
NSString containing the value of the header key.
Version
1.0
- (NSString *) queryParamValueForKey: (NSString *)  key

Gets the value of a specified query parameter.

Parameters
keyThe name of the query parameter to get the value for. Cannot be nil.
Returns
NSString containing the value of the query parameter key.
Version
1.0
- (void) removeAllHeaders

Deletes all header key-value pairs.

Version
1.0
- (void) removeAllQueryParams

Deletes all query parameter key-value pairs.

Version
1.0
- (void) removeHeaderForKey: (NSString *)  key

Removes the header that matches key from the dictionary of headers.

Parameters
keyThe name of the header to remove. Cannot be nil.
Version
1.0
- (void) removeQueryParamForKey: (NSString *)  key

Removes the query parameter that matches key from the dictionary of query parameters.

Parameters
keyThe name of the query parameter to remove. Cannot be nil.
Version
1.0
- (void) setHeaderValue: (NSString *)  value
forKey: (NSString *)  key 

Adds or changes an existing header value.

Parameters
valueThe value of the header. Cannot be nil.
keyThe name of the header to add or change. Cannot be nil.
Version
1.0
- (void) setQueryParamValue: (NSString *)  value
forKey: (NSString *)  key 

Adds or changes an existing query parameter value.

Parameters
valueThe value of the query parameter. Cannot be nil.
keyThe name of the query parameter to add or change. Cannot be nil.
Version
1.0

Property Documentation

- (AKHTTPBody*) bodyData
readwritenonatomicretain

Data to set in the HTTP request's post data.

Version
1.0
- (NSData*) data
readwritenonatomicstrong

Raw data to set in the HTTP request's post data.

Version
1.0
- (NSDictionary*) headers
readnonatomicassign

Name value pairs to set in the HTTP request's header.

Version
1.0
- (NSDictionary*) queryParams
readnonatomicassign

Name value pairs to append to the URL's query string.

Version
1.0