title: Send Nested JSON using AFNetworking
body: <p>To send registration data to server, I am using JSON is in following form: </p>
  
  <pre><code>{"regData": {
   "City":"Some City",
   "Country":"Some Country",
   "Email_Id":"abc@gmail.com",
   "MobileNumber":"+00xxxxxxxxxx",
   "UserName":"Name Of user"
   }
  }
  </code></pre>
  
  <p>Here is how am sending.</p>
  
  <pre><code> NSURL * url = [[NSURL alloc] initWithString:registerUrlString];
              AFHTTPClient * httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
              httpClient.parameterEncoding = AFJSONParameterEncoding;
              [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
              NSDictionary * params = @{@"regData": @{
                                                @"City": self.cityField.text,
                                                @"Country": self.countryField.text,
                                                @"Email_Id": self.emailField.text,
                                                @"MobileNumber": self.numberField.text,
                                                @"UserName": self.userName.text,
                                                }
                                        };
  
              NSMutableURLRequest * request = [httpClient requestWithMethod:@"POST" path:registerUrlString parameters:params];
              AFHTTPRequestOperation * operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
                  NSLog(@"Success: %@", JSON);
  
              } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
              NSLog(@"Error: %@", [error debugDescription]);
              }];
  
              [operation start];
  </code></pre>
  
  <p>But unfortunately I am getting this error:</p>
  
  <p><code>Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x94b3c30 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}</code></p>