Skip to content

Instantly share code, notes, and snippets.

@allometry
Created March 25, 2009 02:55
Show Gist options
  • Save allometry/84525 to your computer and use it in GitHub Desktop.
Save allometry/84525 to your computer and use it in GitHub Desktop.
var request = [CPURLRequest requestWithURL:"http://brs.allometry.com/users/login"];
var requestJSON = {"Username":"sjabour","Password":"1234567"};
[request setHTTPMethod:@"POST"];
[request setHTTPBody:CPJSObjectCreateJSON(requestJSON)];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"UTF-8" forHTTPHeaderField:@"charset"];
var connection = [CPURLConnection connectionWithRequest:request delegate:self];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment