Skip to content

Instantly share code, notes, and snippets.

@pita5
Created August 1, 2012 15:59
Show Gist options
  • Save pita5/3228154 to your computer and use it in GitHub Desktop.
Save pita5/3228154 to your computer and use it in GitHub Desktop.
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://staging.fuerteint.com/projects/polligraf/login.php"]];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[NSJSONSerialization dataWithJSONObject:@{ @"username" : @"some_username_here", @"pass" : @"some_password_here" } options:0 error:nil]];
NSURLResponse* response;
NSError* error;
[NSURLConnection sendSynchronousRequest:request
returningResponse:&response
error:&error];
NSLog(@"%@", response);
if (error) {
NSLog(@"%@", error.localizedDescription);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment