Skip to content

Instantly share code, notes, and snippets.

@ashtom
Created April 10, 2009 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashtom/93017 to your computer and use it in GitHub Desktop.
Save ashtom/93017 to your computer and use it in GitHub Desktop.
// How to encode NSData for a HTTP request
NSString *dataString = [[NSString alloc] initWithFormat:@"%@", someData];
NSString *dataEncoded = [dataString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"Encoded data = %@", dataEncoded);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment