• 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
Parse an HTTP Query String into a Dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Parse an HTTP Query String into a Dictionary


  • Subject: Parse an HTTP Query String into a Dictionary
  • From: Jerry Krinock <email@hidden>
  • Date: Thu, 7 Aug 2008 17:55:01 -0700

Before I write the implementation for this NSString category method, I'd like to know if it's already already available somewhere:

@interface NSString (URIQuery)

/*!
@method queryDictionary
@abstract Assuming that the receiver is a query string of key=value pairs,
of the form "key0=value0&key1=value1&...", with keys and values percent-escape
encoded per RFC 2396, returns a dictionary of the keys and values.
@discussion If I recall correctly, ";" can also be used in place of the "&" delimiter
*/
- queryDictionary ;


@end

It seems like it would not be too difficult to implement using NSScanner and CFURLCreateStringByReplacingPercentEscapes(), but I've done enough things that "seemed like it would not be too difficult" to know that tested code is always preferable.

Thanks,

Jerry


_______________________________________________

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


  • Prev by Date: Re: Confusion over FSMoveObjectToTrashSync docs
  • Next by Date: Re: CGImageSourceCreateFromURL failed with error -11
  • Previous by thread: Re: Framework and NSApplication
  • Next by thread: Problem with friend function and gcc 4.2 with objective-c++
  • Index(es):
    • Date
    • Thread