Skip to content

Instantly share code, notes, and snippets.

@saikat
Created August 13, 2009 03:06
Show Gist options
  • Save saikat/166933 to your computer and use it in GitHub Desktop.
Save saikat/166933 to your computer and use it in GitHub Desktop.
var request = [CPURLRequest requestWithURL:serverRoot + "/login/"],
JSONString = '{"email" : "something"}';
[request setHTTPMethod: "POST"];
[request setHTTPBody: JSONString];
[request setValue:"application/json" forHTTPHeaderField:"Accept"] ;
[request setValue:"application/json" forHTTPHeaderField:"Content-Type"] ;
return [CPURLConnection connectionWithRequest:request delegate:self];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment