Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
QQ:
If 90% of requests get a (202) Accepted but the odd one requires some more information, what httpstatuscode I return to signal this?

I.E.:

request:
POST (host/sale/endpoint)
Sales data

response: 202




POST (host/sale/endpoint)
Sales data


response: ??
We need to know the collection date


^ bad example but you get the idea

This issue is that in some cases we need to start processing the order so as to hit the issue in the first place.

so what status code says "Thanks for this info, can we have a bit more before completing that last request, please"?

I'm sure there's no hard rule, but as long as you can justify your choice, I can try to justify it to my team ^_^

Thanks
Andy

What I have tried:

I looked at decimal responses but not sure what that would affect. We do have full control over the clients so we could add a custom status code if we needed.
Posted
Updated 15-Oct-18 8:38am
Comments
summiya1 15-Oct-18 13:02pm    
I think you should return back 200 response with your response message asking for more information.
Andy Lanng 16-Oct-18 3:54am    
Oh thanks. Didn't look at the first link on google at all!
MadMyche 16-Oct-18 9:19am    
IMHO one of the best lists out there.
Andy Lanng 16-Oct-18 11:31am    
agreed

1 solution

I'm a big proponent of using the codes that are already out there.

In your case "Thanks for this info, can we have a bit more before completing that last request, please", I would be inclined to use an IIS extended code:

449 Retry With: The server cannot honour the request because the user has not provided the required information
 
Share this answer
 
Comments
Andy Lanng 16-Oct-18 3:55am    
Ooh - didn't see that one. Looks perf ^_^
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900