1

I am preparing a special string, in which keys are values are concatenated like below:

username=foo&age=24&email=foo@bar.com&homepage=http://foo.com
  • & is the separator for two key=value pairs
  • value is url encoded

I have a scenario where there are multiple home pages for a user. I want to specify multiple urls for the homepage key

name=foo&age=24&email=foo@bar.com&homepage=url1<some_safe_url_separator_char>url2<some_safe_url_separator_char>url3
  • We have no control/idea over what url1, url2, .. may contain?

What is a good choice of some_safe_url_separator_char?

In other words I am not looking for a safe character to be used IN a url, but a safe character to be used to SEPARATE two urls in a string

Beau Grantham
  • 3,435
  • 5
  • 33
  • 43
smc
  • 710
  • 1
  • 9
  • 26
  • you can use a `JSON` to pass data.instead of making a bulky url – Divya Nov 03 '14 at 17:05
  • 1
    Could you not pass multiple homepage variables? `name=foo&age=24&email=foo@bar.com&homepage=url1&homepage=url2&homepage=url3` [see here](http://stackoverflow.com/questions/1746507/authoritative-position-of-duplicate-http-get-query-keys) – Holloway Nov 03 '14 at 17:05
  • @Ashes JSON is not a choice, that I can make. The format is fixed – smc Nov 03 '14 at 17:08
  • @Trengot I cannot repeat the same key; the parser is not designed to parse repeated keys – smc Nov 03 '14 at 17:08
  • Can the homepage URLs also contain a path/query/fragment? – unor Nov 05 '14 at 14:43

1 Answers1

-1

well you can use URL re-writing for this .

It will make a URL that will be safe as it will hide the name of parameters

For refrence you can use URL rewriting

URL rewriting will make a url seprated by '/' and its tough to be decoded by an external person. you can follow links i'm posting

URL rewriting for beginners

Divya
  • 1,469
  • 1
  • 13
  • 25