dan
dan

Reputation: 45662

Is it more RESTful to create a resource with a JSON payload or regular POST parameters?

I'm making an API & wondering whether to design a factory endpoint to take a JSON payload representing the attributes of the resource to be created, or regular application/x-www-form-urlencoded parameters in the request body, or whether it does not matter at all from a REST standpoint.

Upvotes: 3

Views: 237

Answers (1)

Yuriy Zubarev
Yuriy Zubarev

Reputation: 2871

It's equally RESTful in either case. You're just using different formats (representations). No format is intrinsically more RESTful than the other.

Upvotes: 4

Related Questions