Menu
Back to Discussions

api design, query parameters versus request body for post requests

Amine Benali
Amine Benali
·2759 views
Hey everyone, I'm designing a new API endpoint for creating a resource that has a bunch of optional attributes. I'm trying to figure out if I should pass those optional attributes as query parameters or put them in the request body. My first instinct is to use query parameters for simple GET requests, but for POST, it feels a bit less clear. What do you all think are the best practices? When have you seen one way work out better than the other?
35 comments

Comments

Loading comments...