Skip to content

Instantly share code, notes, and snippets.

@marshluca
Created August 24, 2010 02:58
Show Gist options
  • Save marshluca/546837 to your computer and use it in GitHub Desktop.
Save marshluca/546837 to your computer and use it in GitHub Desktop.
NSURL *url = [NSURL URLWithString:@"http://api.woyiwang.com:4001/test_post_login"];
NSString *body = [NSString stringWithFormat: @"param1=%@&param2=%@",value1,value2];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [body dataUsingEncoding: NSUTF8StringEncoding]];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment