Skip to content

Instantly share code, notes, and snippets.

@iwaffles
Created July 3, 2014 22:54
Show Gist options
  • Save iwaffles/136b2e15161472045c57 to your computer and use it in GitHub Desktop.
Save iwaffles/136b2e15161472045c57 to your computer and use it in GitHub Desktop.
Query Params with AFNetworking
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *params = @{
@"name": name,
@"another_value": something_else
};
NSString *urlString = @"http://postSomethingHere.com/";
[manager POST:urlString
parameters:params
constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
} success:^(AFHTTPRequestOperation *operation, id responseObject) {
//success
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"error: %@", error);
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment