You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I am not mistaken, many web servers see the plus symbol ("+") as a substitute for a white space or ("%20") when sent as a query param in the URL.
In the JSON API spec, the format for sending sorting criteria to a collection endpoint is:
GET /people?sort=+age,+name
However, my Rails API code sees params[:sort]= age, name (with blank spaces before age and name). In hunting around on Google, it seems this is not limited to Rails; it is expected behavior for query params --- +'s are intended to be shorthand for spaces.
Which raises the question: when the spec says to use GET /people?sort=+age,+name, should the +'s be literal and the server should compensate for the +'s or resulting white spaces? Or are the +'s expected to be URL encoded like GET /people?sort=%2bage,%2bname?
The text was updated successfully, but these errors were encountered:
If I am not mistaken, many web servers see the plus symbol ("+") as a substitute for a white space or ("%20") when sent as a query param in the URL.
In the JSON API spec, the format for sending sorting criteria to a collection endpoint is:
However, my Rails API code sees
params[:sort]= age, name
(with blank spaces beforeage
andname
). In hunting around on Google, it seems this is not limited to Rails; it is expected behavior for query params --- +'s are intended to be shorthand for spaces.Which raises the question: when the spec says to use
GET /people?sort=+age,+name
, should the +'s be literal and the server should compensate for the +'s or resulting white spaces? Or are the +'s expected to be URL encoded likeGET /people?sort=%2bage,%2bname
?The text was updated successfully, but these errors were encountered: