Closed Bug 1164205 Opened 10 years ago Closed 10 years ago

search suggest api should require JSON-encoded bodies in requests

Categories

(support.mozilla.org :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: willkg)

References

Details

The search suggest API currently lets you put the q value in the querystring or raw in the body of the HTTP request. That feels kind of weird for a JSON API. This bug covers making the following changes: 1. all fields are passed in via the request body OR the querystring 2. the request body is JSON-encoded
These should both be valid examples (pretty sure I've got the curl correct here): curl -X GET "https://support.mozilla.org/api/2/search/suggest/?q=videos&max_documents=3&max_questions=0" curl -X GET https://support.mozilla.org/api/2/search/suggest/ -d ' { "q": "videos", "max_documents": 3, "max_questions": 0 }' In the new regime, this would NOT be valid: curl -X GET "https://support.mozilla.org/api/2/search/suggest/?max_documents=3&max_questions=0" -d ' { "q": "videos" }'
Grabbing this to work on. Going to try to push most of the work to DRF if possible.
Assignee: nobody → willkg
Status: NEW → ASSIGNED
Deployed to prod.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.