Navigation Menu

Skip to content

cleverua/iphone_url_request_builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

DESCRIPTION

The builder allows to create GET/POST requests with attached files.

Tested with Rails 3

USAGE

// fill NSDictionary with request parameters
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
                                  @"first value", @"param_name_1",
                                  @"second value", @"param_name_2", nil];

URLRequestBuilder *builder = [[URLRequestBuilder alloc] initWithMethod:RequestMethodPost 
                                                                   url:@"http://some.host.name/path"
                                                            parameters:params];
// get NSURLRequest initialized with parameters
NSURLRequest * request = builder.request;

NSURLConnection * conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[builder release];
[params release];
...