What is the preferred Internet media type of a RESTful POST request?

Posted by rdasxy on Programmers See other posts from Programmers or by rdasxy
Published on 2012-04-15T02:09:28Z Indexed on 2012/04/15 5:43 UTC
Read the original article Hit count: 172

Filed under:

Is there a preferred/recommended Internet Media Type for RESTful POST requests?

For example, if I want to add a new user, should I send the data as a URL encoded string like:

name=Foo&otherData=Bar

or does REST recommend I send the data as whatever format the response is going to be sent as (e.g. JSON/XML)?

<user>
  <name>Foo</name>
  <other-data>Bar</other-data>
</user>

© Programmers or respective owner

Related posts about rest