http - REST: return ok on put with additional info about data -


i have api resource user profile (consumed mobile app). user can submit data via put , response. in case of incorrect data return 422 , error explanation, otherwise 200.

but there 1 state of data correct in terms of domain logic, requires manual intervention admin. in case request successful, need show user message situation exceptional , investigated admin.

the question is: how can restfully? 202 status? or 200 , plain text message? or create resource profile/verify , use right after submitting new data?

yep. http 202 fit scenario. can read in rfc 7231

the 202 (accepted) status code indicates the request has been
accepted processing, processing has not been completed.
request might or might not acted upon, might
disallowed when processing takes place.
there no
facility in http re-sending status code asynchronous
operation.

the 202 response intentionally noncommittal. its purpose allow server accept request other process (perhaps batch-oriented process run once per day) without requiring user agent's connection server persist until process completed. the representation sent response ought describe request's current status , point (or embed) status monitor can provide user estimate of when request fulfilled.

emphasis mine.

so should send response 202 status in header, , message describing reason inform user request valid , being processed , he should not repeat request.

but there 1 state of data correct in terms of domain logic, requires manual intervention admin.

this corresponds

the request might or might not acted upon, might disallowed when processing takes place.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -