AFNetworking/AFNetworking — Issue #132: Nested dictionary params does not work with Rails Backend (at least)
Author: seivan
Created: 2011-11-28 06:17:38+00:00
State: open

```objective-c
using AFJSONParameterEncoding I get Parameters: {"user"=>{}} and using AFFormURLParameterEncoding I get
Parameters: {"user"=>"{\n \"facebook_access_token\" = blablabla ;\n}"}
NSDictionary *params2 = [NSDictionary
dictionaryWithObject:facebook.accessToken forKey:@"facebook_access_token"];
NSDictionary *params = [NSDictionary
dictionaryWithObject:params2 forKey:@"user"];

AFHTTPClient *httpClient = [[[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:kAPIUrl]] autorelease];

NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST"
path:@"users.json"
parameters:params];

AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"Name: %@ %@", [JSON valueForKeyPath:@"first_name"], [JSON valueForKeyPath:@"last_name"]);
} failure:nil];
```