Reputation: 1213
I am writing a project in Javascript using node.js, express and mongodb which includes an API for POSTing images to a server.
When GETting them, the necessary parameters goes in querystring, like:
domain.com/api/imgs?firstParam=XXX&secondParam=YYY
Am not sure about best way to send POST data. My ideas so far are :
Send data entirely in the querystring (except base64 encoded img itself which will be in POST data)
Reuse the GET parameters from the querystring (I need to update data in DB), then send the additional parameters with POST
What would be best practice in this situation?
Upvotes: 2
Views: 3447
Reputation: 169
It's most common on POST to use JSON.
Off the top of my head here are a few reasons why:
Upvotes: 7