• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURLConnection POST issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSURLConnection POST issues (From: Damien Cooke <email@hidden>)

  • Prev by Date: Re: What's the right way to make the last (or only) table column fill the width of an NSTableView?
  • Next by Date: Re: prepareSavePanel - save as or save to?
  • Previous by thread: Re: NSURLConnection POST issues
  • Next by thread: [self frame].size.width reporting incorrectly
  • Index(es):
    • Date
    • Thread