java - What is the HTTP status return code for a successful DELETE statement in REST? -


i studying how spring handle rest web services (but don't know if spring related answer or more generically related rest concept).

so doubt is: http status return code successful delete statement?

is 204 or 200?

i know 200 means request correctly fulfilled reading online seems me expect after successful returning content , not after delete.

somewhere found 204 status obtained after successful put or delete. true? can't understand, means the response empty, why empty respons means put or delete operation gone succesfull?

there no strict rules on http status code correct 1 each method. depends on happened, information need send client, etc. can think of few examples:

  • a successful delete, no further information. 204 no content

  • a successful delete, have warning related orphan resources should deleted too. 200 ok.

  • you accepted delete request, might take long time , you're going asynchronously. client should check later. 202 accepted.

  • you accepted delete request, resource can't removed , uri instead reset default. 205 reset content.


Popular posts from this blog