0

My application needs to save user POST data with inactive status 'true' if one of the validation fails.

What should be the http response code if I need to communicate request being saved but with inactive status true?

Sujit
  • 1
  • Possible duplicate of [REST HTTP status codes for failed validation or invalid duplicate](http://stackoverflow.com/questions/3290182/rest-http-status-codes-for-failed-validation-or-invalid-duplicate) – Ken Jan 31 '17 at 06:46

1 Answers1

0

I guess you can return status code 202 Accepted, which means accepted but not processed.

202 Accepted

The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.

Rahul Kumar
  • 2,781
  • 1
  • 21
  • 29
  • Is there any way I can communicate through response body if the status is changed to inactive? – Sujit Jan 31 '17 at 17:51
  • I guess you meant that send a response when the user status changes from inactive to active? No you cannot, for that you would have to do polling or if you are really willing then implement websocket. The rest api only tells that the request is accepted and will be processed later, after that the particular rest call is done. – Rahul Kumar Feb 01 '17 at 12:35