Http Status Codes Rest Error
Contents |
Successful3xx - Redirection4xx - Client Error5xx - Server Error HTTP Status Codes Last modified 22:51, 22 May 2012 Table of contents1xx - Informational2xx - Successful3xx - Redirection4xx - Client rest http status codes best practices Error5xx - Server Error Each Status-Code is described below, including a description of which
Http Status Code 422
method(s) it can follow and any metainformation required in the response. 1xx - Informational This class of status code indicates
Http Status Code 400
a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. There are no required headers for this class of status code. Since HTTP/1.0 did not define
Http Status Codes 404
any 1xx status codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client except under experimental conditions. A client MUST be prepared to accept one or more 1xx status responses prior to a regular response, even if the client does not expect a 100 (Continue) status message. Unexpected 1xx status responses MAY be ignored by a user agent. Proxies MUST forward 1xx responses, unless the connection http status codes cheat sheet between the proxy and its client has been closed, or unless the proxy itself requested the generation of the 1xx response. (For example, if a proxy adds a "Expect: 100-continue" field when it forwards a request, then it need not forward the corresponding 100 (Continue) response(s).) 100 - Continue101 - Switching Protocols 2xx - Successful This class of status code indicates that the client's request was successfully received, understood, and accepted. 200 - OK201 - Created202 - Accepted203 - Non-Authoritative Information204 - No Content205 - Reset Content206 - Partial Content207 - Multi-Status 3xx - Redirection This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. The action required MAY be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD. A client SHOULD detect infinite redirection loops, since such loops generate network traffic for each redirection. Note: previous versions of this specification recommended a maximum of five redirections. Content developers should be aware that there might be clients that implement such a fixed limitation. 300 - Multiple Choices301 - Moved Permanently302 - Found303 -
is Azure Enterprise IT Application Hosting Azure vs. Amazon Web Services Azure in China Services COMPUTE Virtual Machines Web http response example Sites Mobile Services Cloud Services DATA SERVICES Storage SQL Database HDInsight http status code checker Cache Backup Recovery Manager APP SERVICES Media Services Services Bus Notification Hubs Scheduler BizTalk Services Visual rest status for whatsapp Studio Online Active Directory Multi-Factor Authentication Automation CDN NETWORK SERVICES ExpressRoute Virtual Network Traffic Manager Case Studies Pricing Overview Pricing Details COMPUTE Virtual Machines Web Sites http://www.restpatterns.org/HTTP_Status_Codes Mobile Services Cloud Services DATA SERVICES Storage SQL Database HDInsight Cache Backup Site Recovery APP SERVICES Media Services Service Bus Notification Hubs Scheduler Automation BizTalk Services Visual Studio Online Active Directory Multi-Factor Authentication CDN NETWORK SERVICES ExpressRoute Virtual Network Traffic Manager Data Transfers Calculator Purchase Options Member Offers MSDN BizSpark Startups Microsoft Partner Network Regions https://msdn.microsoft.com/en-us/library/azure/dd179357.aspx Support Plans FAQ Documentation Downloads Add-ons Community Blog Service Updates Events Partners Education Newsletter Support Support Options Support Plans Forums Service Dashboard Trust Center Overview Security Privacy Compliance Legal FAQ Azure Reference Storage Services REST Status and Error Codes Status and Error Codes Common REST API Error Codes Common REST API Error Codes Common REST API Error Codes Common REST API Error Codes Blob Service Error Codes Queue Service Error Codes Table Service Error Codes File Service Error Codes Troubleshooting API Operations TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. Common REST API Error Codes Updated: June 29, 2016The error codes listed in the following table may be returned by an operation on any of the storage services.Error codeHTTP status codeUser messageConditionNotMetNot Modified (304)The condition specified in the conditional header(s) was not met for a read operation.MissingRequiredHeaderBa
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn http://stackoverflow.com/questions/3290182/rest-http-status-codes-for-failed-validation-or-invalid-duplicate more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, http://restcookbook.com/HTTP%20Methods/400-vs-500/ helping each other. Join them; it only takes a minute: Sign up REST HTTP status codes for failed validation or invalid duplicate up vote 460 down vote favorite 128 I'm building an application with a REST-based API http status and have come to the point where i'm specifying status codes for each requests. What status code should i send for requests failing validation or where a request is trying to add a duplicate in my database? I've looked through http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html but none of them seems right. Is there a common practice when sending status codes? http rest http-status-codes share|improve this question edited Sep 3 '14 at 15:02 Raedwald 17.6k1265104 asked Jul 20 '10 at 13:03 http status code alexn 33.7k878119 3 See: stackoverflow.com/questions/1959947/… –deamon Jul 20 '10 at 13:39 6 Open httpstatus.es, Right Click >> Pin Tab :P –Salman Abbas May 24 '12 at 5:00 add a comment| 7 Answers 7 active oldest votes up vote 413 down vote accepted For input validation failure: 400 Bad Request + your optional description. This is suggested in the book "RESTful Web Services". For double submit: 409 Conflict Update June 2014 The relevant specification used to be RFC2616, which gave the use of 400 (Bad Request) rather narrowly as The request could not be understood by the server due to malformed syntax So it might have been argued that it was inappropriate for semantic errors. But not any more; since June 2014 the relevant standard RFC 7231, which supersedes the previous RFC2616, gives the use of 400 (Bad Request) more broadly as the server cannot or will not process the request due to something that is perceived to be a client error share|improve this answer edited Sep 23 '14 at 17:50 Johannes Rudolph 23.8k875137 answered Jul 20 '10 at 13:05 deamon 25.5k61206323 1 Yes, the request body is part of the syntax. –deamon Jul 20 '10 at 13:22 40 Bad request is definitely the most common response to this kind of issue. The only other alternative is 422 Unprocessable Entity. It actually comes
fix the error first. 5xx codes tell the client something happened on the server and their request by itself was perfectly valid. The client can continue and try again with the request without modification. If your API is trying to save a record to a database and this fails because there is an error with the database, for instance, it's not reachable, or a constraint fails, use a 5xx code (preferably 500 - Internal server error). Always add a response to what went wrong. This response SHOULD be displayed to the client, or if it's an automated system, it can retry again with the same request. If you as a client receive a 500 status code, you can decide to try again (after a waiting-period, for a set number of times) to see if the server can handle the same request later on. Some status codes like 503 can return a retry-after header. This can be used to figure out how long a client SHOULD wait until a next attempt should be tried. Please enable JavaScript to view the comments powered by Disqus. Topics Basics (5 recipes) How do I let users log into my RESTful API? Caching your REST API How do I version my REST API? What is HATEOAS and why is it important? What is the code-on-demand constraint? HTTP Headers (1 recipe) Unsatisfied Accept-Language header HTTP Methods (5 recipes) How do I know which HTTP methods are supported When to use PUT or POST When to use the PATCH method What are idempotent and/or safe methods? When to send 4xx or 5xx codes Mediatypes (1 recipe) Is my API RESTful when I use JSON? Miscellaneous (3 recipes) What is the Richardson Maturity Model? Are REST and HTTP the same thing? Where to find REST presentations Resources (4 recipes) Custom content-types Paginating collections Using link-types in relations Asynchronous operations Maintained by Joshua Thijssen | Powered by Jekyll & GitHub | Design adapted on jekyll theme by UniFreak