Re: NSURLConnection POST issues
Re: NSURLConnection POST issues
- Subject: Re: NSURLConnection POST issues
- From: Gordon Henriksen <email@hidden>
- Date: Tue, 12 Jan 2010 12:20:56 -0500
On 2010-01-09, at 22:31, Damien Cooke wrote:
> [appendedData appendData:[[[NSString stringWithFormat:@"ProdBuild=%@",[self productBuild]] stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding]dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]];
As an aside, note that stringByAddingPercentEscapesUsingEncoding: is only suitable for cleaning up URLs (like in Safari's address bar), not for encoding arbitrary user input into a form data blob. If there's any possibility that userComment or your other variables contains any of the form data metacharacters (&, =, and %), you'll need to roll your own escaping to get the input to round-trip correctly.
— Gordon
P.S. CFString's percent escaping API behaves similarly.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden