So I'm currently using Facebook to login to my iOS app, and the server administrator recently added security authentication by requiring a Facebook access token along with making all connections go via https. Here's the code I've tried running, but I've been getting a server response error of 500 (internal server error) no matter what I do. Any ideas?
NSMutableURLRequest *request = [NSMutableURLRequest
requestWithURL:[NSURL URLWithString:@"https://XXXXXXXXXXXXXXXX/users.json"]];
NSDictionary *requestData = [[NSDictionary alloc] initWithObjectsAndKeys:
userID, @"facebook_id",
FBAccessToken, @"fb_token",
userName, @"name",
nil];
NSError *error;
NSData *postData = [NSJSONSerialization dataWithJSONObject:requestData options:0 error:&error];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:postData];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];