ConstantContact iOS SDK
Class Methods | List of all members
HttpRequest Class Reference

#import <HttpRequest.h>

Inheritance diagram for HttpRequest:

Class Methods

(HttpResponse *) + getWithUrl:andHeaders:
 
(HttpResponse *) + postWithUrl:andHeaders:andStringData:
 
(HttpResponse *) + putWithUrl:andHeaders:andStringData:
 
(HttpResponse *) + patchWithUrl:andHeaders:andStringData:
 
(HttpResponse *) + deleteWithUrl:andHeaders:
 
(HttpResponse *) + httpRequestWithUrl:andMethod:andHeaders:andStringData:
 
(HttpResponse *) + httpMultipartRequestWithUrl:file:data:lists:
 
(HttpResponse *) + httpMultipartRequestWithUrl:file:folderId:description:source:data:
 
(NSDictionary *) + headersWithAccessToken:
 

Method Documentation

+ (HttpResponse *) deleteWithUrl: (NSString*)  url
andHeaders: (NSDictionary*)  headers 

Function is used to make a Http DELETE request;

Parameters
NSString*Url - the request url for the call;
NSArray*Headers - a array of all http headers to send;
NSString*stringData - aditional data to send with request;
Returns
HttpResponse* - The function returns a response that contains the calls returned value;
+ (HttpResponse *) getWithUrl: (NSString*)  url
andHeaders: (NSDictionary*)  headers 

Function is used to make a Http GET request;

Parameters
NSString*Url - the request url for the call;
NSArray*Headers - a array of all http headers to send;
Returns
HttpResponse* - The function returns a response that contains the calls returned value;
+ (NSDictionary *) headersWithAccessToken: (NSString*)  accessToken

Helper function to return required headers for making an http request with constant contact

Parameters
accessToken- OAuth2 access token to be placed into the Authorization header
Returns
NSArray - authorization headers
+ (HttpResponse *) httpMultipartRequestWithUrl: (NSString *)  urlString
file: (NSString *)  fileName
data: (NSData *)  data
lists: (NSString *)  lists 

Function is used to make a Http multipart request for bulk activityes;

Parameters
NSString*Url - the request url for the call;
NSString*fileName - the filename of the file sent to the server (first part of the multipart);
NSString*data - the data from the selected file in string format (second part of the multipart);
NSString*lists - a string containing the lists where the contacts will be added;
Returns
HttpResponse* - The function returns a response that contains the calls returned value;
+ (HttpResponse *) httpMultipartRequestWithUrl: (NSString *)  urlString
file: (NSString *)  fileName
folderId: (NSString *)  folderId
description: (NSString *)  description
source: (NSString *)  source
data: (NSData *)  data 

Function is used to make a Http multipart request for MyLibrary files;

Parameters
NSString*Url - the request url for the call;
NSString*fileName - the filename of the file sent to the server;
NSString*folderId
NSString*description
NSString*source
NSString*data - the data from the selected file in string format (second part of the multipart);
Returns
HttpResponse* - The function returns a response that contains the calls returned value;
+ (HttpResponse *) httpRequestWithUrl: (NSString*)  url
andMethod: (NSString*)  method
andHeaders: (NSDictionary*)  headers
andStringData: (NSString*)  stringData 

Function is used to make a Http request;

Parameters
NSString*Url - the request url for the call;
NSArray*Headers - a array of all http headers to send;
NSString*StringData - aditional data to send with request;
NSString*Method - the method type of the request ( PUT, GET, DELETE, etc.);
Returns
HttpResponse* - The function returns a response that contains the calls returned value;
+ (HttpResponse *) patchWithUrl: (NSString*)  url
andHeaders: (NSDictionary*)  headers
andStringData: (NSString*)  stringData 

Function is used to make a Http PATCH request;

Parameters
NSString*Url - the request url for the call;
NSArray*Headers - a array of all http headers to send;
NSString*stringData - aditional data to send with request;
Returns
HttpResponse* - The function returns a response that contains the calls returned value;
+ (HttpResponse *) postWithUrl: (NSString*)  url
andHeaders: (NSDictionary*)  headers
andStringData: (NSString*)  stringData 

Function is used to make a Http POST request;

Parameters
NSString*Url - the request url for the call;
NSArray*Headers - a array of all http headers to send;
NSString*stringData - aditional data to send with request;
Returns
HttpResponse* - The function returns a response that contains the calls returned value;
+ (HttpResponse *) putWithUrl: (NSString*)  url
andHeaders: (NSDictionary*)  headers
andStringData: (NSString*)  stringData 

Function is used to make a Http PUT request;

Parameters
NSString*Url - the request url for the call;
NSArray*Headers - a array of all http headers to send;
NSString*stringData - aditional data to send with request;
Returns
HttpResponse* - The function returns a response that contains the calls returned value;

The documentation for this class was generated from the following files: