Created
October 12, 2012 00:41
-
-
Save cconger/3876668 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:"http://127.0.0.1/test"]; | |
[request setHTTPMethod:@"POST"]; | |
[request setHTTPBody:[@"{json:goes, here:0}" dataUsingEncoding:nSUTF8StringEncoding]]; | |
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; | |
NSURLConnection* conn = [[NSURLConnection alloc] initWithRequest:request delegate:self]; | |
[conn start]; | |
//Then implement the delegate methods on self | |
// Defined here: https://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment