Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any format convention in query strings?

I was wondering if you normally capitalise any letter in query strings, use dashes or underscores for variable names, or have any other query string naming convention. I cannot find any reference to it.

Edit: Since there seems to be no convention, are there any best practices or usual way to do it?

like image 304
Badger Cat Avatar asked May 21 '12 14:05

Badger Cat


2 Answers

I don't recall actually ever seeing people use dashes in parameter names in the query string. That probably shoots it down as best practice.

I would personally avoid camel case because I don't want to get into case sensitivity/insensitivity issues.

That leaves underscores, which I find is commonly used.

like image 73
jgivoni Avatar answered Sep 19 '22 07:09

jgivoni


There is no convention in this case at all. URLs (in .NET at least) are case insensitive anyway.

like image 24
Sachin Kainth Avatar answered Sep 20 '22 07:09

Sachin Kainth