Using comma vs underscore in urls

142 Views Asked by At

Only the first one works, second and third do not. Any ideas why?

http://abc.def.ghi.com:8080/mango?ll=76.93839283938492_-145.126282939231&locale=en_US&q= //returns json response

http://abc.def.ghi.com:8080/mango?ll=76.93839283938492,-145.126282939231&locale=en_US&q= //does not work, gives "Bad Request"

http://abc.def.ghi.com:8080/mango?ll=76.93839283938492%2C-145.126282939231&locale=en_US&q= //does not work, gives "Bad Request"
1

There are 1 best solutions below

0
On

Okay so, here is my understanding. In general, comma's are not typically used in URL's, but it is possible to have them, just not commonly practiced. For your #2 and #3 lines, there are a couple of things that could be causing the bad requests to happen.

Here is a link worth looking into to get a better understanding. But from what I understood from it is that when you are using those links, its not encoding the comma's properly to allow you to use them in the URL address. So the interpreter could be stumbling over the addresses once it hits the comma "," because it doesn't know what to do with it.

" https://www.searchenginenews.com/sample/content/are-you-using-commas-in-your-urls-heres-what-you-need-to-know "

Hope this helps, I know my answer isn't much, but you brought up an interesting question! I'm curious to learn more about it too.