Skip to content

Can we make query as name=abc instead of name=%27abc%27 #12

Answered by asmyshlyaev177
DuanTranHuy asked this question in Q&A
Discussion options

You must be logged in to vote

@DuanTranHuy probably we can't.

When parsing values need to know type, 'abc' or %27abc%27 point that value is a string, if we do prop=123 there is no way ahead of time to know type of 123, 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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@franky47
Comment options

@asmyshlyaev177
Comment options

Answer selected by asmyshlyaev177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
wontfix This will not be worked on FAQ General questions about functionality and usage.
3 participants