title: Issues with posting to php page using SBJSON on iPhone
body: <p>I am lending the code from a previous project I have done where it worked perfectly. I have tested the page separately which outputs the data using jQuery and it works fine so I know it is an issue within xcode. </p>
  
  <p>I am using the following code which takes an NSDictionary containing the post data used to get the correct return data:</p>
  
  <pre><code>-(NSDictionary *)loadData:(NSDictionary *) sendDict{
      SBJsonWriter *writer = [SBJsonWriter new];
      NSString * jsonData = [writer stringWithObject:sendDict];
      NSString * getString = [NSString stringWithFormat:@"json=%@", jsonData];
  
      NSData *requestData = [NSData dataWithBytes: [getString UTF8String] length: [getString length]];
      NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: @"http://divisi.co.uk/YTA/custom_api.php"]];
      [request setHTTPMethod: @"POST"];
      [request setHTTPBody: requestData];
  
      NSData *returnData = [ NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil ];
      NSString *returnString = [[NSString alloc] initWithData:returnData encoding: NSUTF8StringEncoding];
  
      NSLog(@"Returned Json: %@", returnString);
  
      // decoding the json
      NSDictionary *loginArray = [NSDictionary alloc];
      loginArray = [returnString JSONValue];
  
      if([[loginArray objectForKey:@"SC"] isEqualToString:@"200"]){
          return [loginArray objectForKey:@"data"];
      }
      else{
          return [loginArray objectForKey:@"error_message"];
      }
  }
  </code></pre>
  
  <p>When I send the post request it finds null on the php side and the json this encodes to be posted is <code>{"method":"getWhatsOn"}</code>, very simple. My test php page just gets this method name and prints it back encoded correctly i.e. <code>{"SC":"200","data":"getWhatsOn"}</code>. Which works in browser using jQuery as I mentioned, but in php the $_POST['method'] returns null when the request comes from the iPhone.</p>