Home What is a correct RESTful service response to a PUT request on successful update?
Reply: 0

What is a correct RESTful service response to a PUT request on successful update?

user849
1#
user849 Published in May 21, 2018, 1:04 pm

What is a correct RESTful service response to a PUT request on successful update?

There are two possible responses that seem to comply with REST architectural style:

  1. Return only a header without body with the status 204.

    Header:

    content-type: application/json; charset=utf-8
    status: 204 No Content
    ratelimit-limit: 5000
    ratelimit-remaining: 4816
    ratelimit-reset: 1444931833
    
  2. Return a header with the status 200 and a body that contains the actual representation of an entity after an update.

    Header:

    content-type: application/json; charset=utf-8
    status: 200 OK
    ratelimit-limit: 5000
    ratelimit-remaining: 4816
    ratelimit-reset: 1444931833
    

    Body:

    {
      "foo": "bar",
      "baz": "qux"
    }
    
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.36955 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO