Can we make query as name=abc instead of name=%27abc%27 #12
-
In your playground page, I see the query url of name is %27abc%27 instead of name=abc Can we make it as name=abc instead? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@DuanTranHuy probably we can't. When parsing values need to know type, So, it's a choice between keeping type of value or keeping URI simpler. But, some browsers already hiding query string from users until click on it, and generally users don't pay much attention to it. There are many libraries that chose simple URI but can't automatically preserve types and structure, nuqs for example. |
Beta Was this translation helpful? Give feedback.
@DuanTranHuy probably we can't.
When parsing values need to know type,
'abc'
or%27abc%27
point that value is a string, if we doprop=123
there is no way ahead of time to know type of123
, e.g number or string. Some special characters get encoded by browser as%CHARCODE
.So, it's a choice between keeping type of value or keeping URI simpler.
But, some browsers already hiding query string from users until click on it, and generally users don't pay much attention to it.
There are many libraries that chose simple URI but can't automatically preserve types and structure, nuqs for example.