• 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: Parameter strings in URLs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parameter strings in URLs


  • Subject: Re: Parameter strings in URLs
  • From: Kay Roepke <email@hidden>
  • Date: Mon, 8 Mar 2004 02:42:32 +0100

On 7. Mrz 2004, at 20:17 Uhr, Ken Tozier wrote:

My best interpretation of the RFC 1808 spec would yield something like:
<a href="http://bla/bla/bla;key1="bobo";key2="ned";key3="gwen";?<some
query here>>

NSString *parameter1, *parameter2, *invalidURL, *validURL;

invalidURL = @"http://bla/bla/bla;key1=\"bobo\";key2=\"ned\";key3=\"gwen\";? whatever=1";
validURL = @"http://bla/bla/bla;key=bobo;key2=ned;key3=gwen?whatever=1";;

parameter1 = [[NSURL URLWithString: invalidURL] parameterString];
parameter2 = [[NSURL URLWithString: validURL] parameterString];
NSLog(@"invalid: %@\nvalid: %@", parameter1, parameter2);


which yields:

invalid: (null)
valid: key=bobo;key2=ned;key3=gwen

So no quotes inside parameter strings, as seen in RFC 1808 (quotes are not in the allowed characterset).
If you need quotes you must escape them! (Using the escape rule as described in RFC 1808).

Kay
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Parameter strings in URLs (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: Using NSView as a template
  • Next by Date: My WebPolicyDelegate always returns false for actionInformation test
  • Previous by thread: Parameter strings in URLs
  • Next by thread: Re: Parameter strings in URLs
  • Index(es):
    • Date
    • Thread