I'd like to use ,
in URL querystring value but it is reserved character. However, we can see many e-commerce sites give comma-galore querystring urls in these days.
What do we consider when we use ,
in querystring? Should it be encoded as %2c
always?
Note that my server-side frameworks are ASP.NET WebApi, dJango, and Node.js.
The URI standard doesn’t define any delimiters for the query component. So none of the reserved characters have a special role there, they all represent data.
The query component may contain the following characters:
a
-z
,A
-Z
0
-9
/
?
:
@
!
$
&
'
(
)
*
+
,
;
=
-
.
_
~
- percent-encoded characters
So you may use ,
and/or %2C
in the query component. Note that ,
and %2C
are not equivalent for normalization purposes (because ,
is part of the reserved set).
All of the above is about the generic URI syntax. URI schemes may define additional delimiters (from the reserved set) for certain components, but the http
/https
URI scheme spec doesn’t do this for the query component.
A possible side effect (like with many other allowed characters, too) is that some auto-linking algorithms might not work correctly.
(The applications you use may of course do something specific with ,
in query strings, but this would be nothing special about this character, it could happen with any other character, too.)