Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort parameter use of literal plus symbol ("+") #486

Closed
realityendshere opened this issue Mar 17, 2015 · 2 comments
Closed

Sort parameter use of literal plus symbol ("+") #486

realityendshere opened this issue Mar 17, 2015 · 2 comments
Milestone

Comments

@realityendshere
Copy link

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?

@tkellen
Copy link
Member

tkellen commented May 20, 2015

resolved in 8c63a72

@tkellen tkellen closed this as completed May 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants