Passing parameters to the JSON Post method in nil
<pre><code>NSString *Str = @"Basic YnRwaXhlbDoxMjM0NQ==";
NSArray *keys = [NSArray arrayWithObjects: @"Authorization",nil];
NSArray *objects = [NSArray arrayWithObjects:Str,nil];
NSDictionary *jsonDictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
NSError * error = nil;
NSData * jsonData = [NSJSONSerialization dataWithJSONObject:jsonDictionary options:NSJSONReadingMutableContainers error:&amp;error];
NSURL *urlStr1 = [NSURL URLWithString:@"http://192.168.0.49/bubbletop/index.php?route=feed/rest_api/gettoken&amp;grant_type=client_credentials"];

NSMutableURLRequest *request1 = [[NSMutableURLRequest alloc] initWithURL:urlStr1]; 
[request1 setHTTPMethod:@"POST"];
[request1 setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request1 setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request1 setValue:[NSString stringWithFormat:@"%lu", (unsigned long)[jsonData length]] forHTTPHeaderField:@"Content-Length"];
[request1 setHTTPBody: jsonData];
_connection = [[NSURLConnection alloc]initWithRequest:request1 delegate:self startImmediately:YES];


NSData *data1 = [NSData dataWithContentsOfURL:urlStr1];


NSDictionary *fashionJson = [NSJSONSerialization JSONObjectWithData:data1 options:kNilOptions error:nil];
NSLog(@"requestReply: %@", fashionJson);
</code></pre>

<p>Here i'm passing the header field parameter as <code>Basic YnRwaXhlbDoxMjM0NQ==</code> for the key <code>Authorization</code> but getting the data as nil and getting log as </p>

<blockquote>
  <p>requestReply: (null)</p>
</blockquote>