Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created December 5, 2009 18:54
Show Gist options
  • Select an option

  • Save ejknapp/249806 to your computer and use it in GitHub Desktop.

Select an option

Save ejknapp/249806 to your computer and use it in GitHub Desktop.
// How to create a POST request to the Flak server
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSData *data = [jsonStringForSession dataUsingEncoding:NSISOLatin2StringEncoding];
[request setHTTPBody:data];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment