-2

https://www.websitename.com/?audience=testingting?internal-abhishek-jwt=random_string

Is this a valid URL? i.e is it fine to have two '?' separators in the URL?

Note: Due to limitations, I can not add '&' to internal-abhishek-jwt=random_string

  • no, it can't, there's only one "?" and for other arguments we write "&" to separate between them – Mhmd Admn Jul 30 '21 at 14:25
  • 1
    The 2nd `?` should be an `&`. Multiple `?` can be included, but they should be `url_encoded` (`?audience=testing%3Finternal- ...`) – Tim Lewis Jul 30 '21 at 14:26
  • 1
    "Due to limitations, I can not add '&'…"—well _that's_ your problem. Ask about _that_. This is an [XY problem](https://meta.stackexchange.com/q/66377/248627). – ChrisGPT was on strike Jul 31 '21 at 23:53

2 Answers2

0

It isn't. You have to URL encode the second one if you want to use it as a parameter or use '&' symbol instead if you wanna separate your arguments (which seems to be the case here).

Some further explanation here

john Smith
  • 17,409
  • 11
  • 76
  • 117
Kirjava
  • 226
  • 1
  • 11
0

The ? still indicates the start of the query string.

Segments of the query string are separated by & characters.

This will be parsed as:

key:   audience
value: testingting?internal-abhishek-jwt=random_string
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335