Closed jorgecara closed 7 years ago
Sorry, I disagree with this change proposal. The W3 standard is very explicit about the use of %
https://www.w3.org/Addressing/URL/4_URI_Recommentations.html
The percent sign The percent sign ("%", ASCII 25 hex) is used as the escape character in the encoding scheme and is never allowed for anything else.
I tried to find alternative schemes but even the use of '*' - while used by some - is not really spec conform:
Other reserved characters The asterisk ("*", ASCII 2A hex) and exclamation mark ("!" , ASCII 21 hex) are reserved for use as having special signifiance within specific schemes.
Here is the section on the RFC https://tools.ietf.org/html/rfc3986#page-12
There are some API's wich do allow the use of 'asterix' as wildcard even though strictly speaking '*' is a reserved sub_delim according to the RFC.
The most appropriate would be to URL encode the wildcard character as part of your search term. Would that work for you?
Sure it would. Actually we are already enconding it so the url would really look like:
GET /cars?type=%25van%25
Why not use a syntax everyone understands and encode asterix. GET /cars?type=%2Avan%2A
IMHO %van%
is less intuitive than *van*
It works for us as well. Should we then agree on using '*' as a wildcard
GET /cars?type=%2Avan%2A
Sometimes the same parameter must have a different behaviour. Without any % it does equality and surrounded by % it does a like comparison.