An easy way to change between GET and POST methods using the same code
structure. Depending the data on parameters and the httpMethod the property urlPath will display the correct url, filling with data the querystring (for GET requests) or the requestBody (for PUT/POST requests). Also added tests.
Starting with the TTURLRequest object:
TTURLRequest *request = [[TTURLRequest alloc] initWithURL:@"http://sample.com" delegate:nil];
If the parameters dictionary is empty, request.urlPath will show:
If we fill the parameters dictionary
NSDictionary* parameters = [NSDictionary dictionaryWithObjectsAndKeys:
@"value1", @"parameter1", @"value2", @"parameter2", nil];
The method request.urlPath now will show:
Using the same request object and changing httpMethod to POST or PUT, request.urlPath will show:
And the parameters will be added to de requestBody
TTURLRequest generate GET query from parameters
Autogenerating GET url query string using the contents on the
Easy to change between GET and POST methods using the same code
Facebook has not maintained or supported Three20 for some time, and we are closing its old and outstanding pull requests.
Many, many thanks for your support of the project. If you have any further questions, please don't hesitate to let me know.