'NSInvalidArgumentException', reason: 'data parameter is nil' showing this error while sending parameters to the url
<p>I write this code for sending the below parameters to given url. But it is showing:</p>

<blockquote>
  <p>'NSInvalidArgumentException', reason: 'data parameter is nil'</p>
</blockquote>

<p>How should I make it correct?</p>

<pre><code>NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[request setObject:@"Nexus 5" forKey:@"device_name"];
[request setObject:@"device id" forKey:@"device_id"];
[request setObject:[userDict valueForKey:@"mobileNumber"] forKey:@"mobile_number"];
[request setObject:@"1.0.0" forKey:@"app_version"];
[request setObject:@"0.0000" forKey:@"latitude:"];
[request setObject:@"0.0000" forKey:@"longitude"];
[request setObject:[userDict valueForKey:@"otp"] forKey:@"otp_number"];
[request setObject:passwordTxtFld.text forKey:@"password"];


NSData *jsonData = [NSJSONSerialization dataWithJSONObject:request options:NSJSONWritingPrettyPrinted error:nil];

NSMutableURLRequest *tRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://192.168.1.4:28901/register"]];
[tRequest setHTTPMethod:@"POST"];
[tRequest setValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[tRequest setValue:[NSString stringWithFormat:@"%lu", (unsigned long)[jsonData length]] forHTTPHeaderField:@"Content-Length"];
[[[NSURLSession sharedSession] dataTaskWithRequest:tRequest completionHandler:^(NSData *data, NSURLResponse *response, NSError *error)
  {
      NSLog(@"%@",data);
      NSDictionary *userDict1 = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
      NSLog(@"Result------------ : %@",userDict1);

  }] resume];
</code></pre>