404 Vs 500 Error
Contents |
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 sp 404 vs mpc 500 Us Learn more about Stack Overflow the company Business Learn more about hiring 404 500 error codes developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the difference between 404 and 500 error Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Should I Return “500” or “404”
403 Vs 404 Error
if a Requested Image is not Found? up vote 3 down vote favorite I work with code written by other people, occasionally I am left somewhat confused and at these times Stack Overflow saves me. Please, save me again. Our site allows people to upload images and later embed them within text in our site like so: My question is: If the identifier, "p", common internet error messages does not lead us to an image should the server return "500" or "404"? I would have thought it should be "404", but that's not what is happening right now. http http-headers http-status-code-404 share|improve this question edited Nov 19 '15 at 1:57 pnuts 33.7k63569 asked May 23 '10 at 15:45 Michael Robinson 19.2k868108 Client error or server error? Use 4xx or 5xx –user216441 May 23 '10 at 15:46 1 It should be 404. Seems like some problem with your code. –User May 23 '10 at 15:48 add a comment| 4 Answers 4 active oldest votes up vote 13 down vote accepted 500 is an error in fulfilling the request. So if the request processed fine and the file is not found, you should return a 404. share|improve this answer answered May 23 '10 at 15:47 Ólafur Waage 49.7k11120174 Thanks for proving I'm neither a moron nor insane. –Michael Robinson May 23 '10 at 16:02 We try our best :) –Ólafur Waage May 23 '10 at 16:03 add a comment| up vote 3 down vote 404 would be (imho) more appropriate. 500 indicates a server error. 404 indicates the resource
/sponsored-data-tutorials/portal /sponsored-data-tutorials/csr /sponsored-data-tutorials/dns /sponsored-data-tutorials/onboarding /sponsored-data-tutorials/docs /sponsored-data-tutorials/faq /sponsored-data-tutorials/simulator/video-1 /sponsored-data-tutorials/simulator/video-2 /sponsored-data-tutorials/simulator/video-3 /sponsored-data-tutorials/simulator/video-4 /sponsored-data-tutorials/simulator/video-5 website error message examples /sponsored-data-tutorials/simulator/video-6 /sponsored-data-tutorials/simulator/video-7 /sponsored-data-tutorials/simulator/video-8 /sponsored-data-tutorials/simulator/video-9
Most Common Http Status Code
/sponsored-data-tutorials/simulator/ineligible-1 /sponsored-data-tutorials/simulator/ineligible-2 /sponsored-data-tutorials/simulator/ineligible-3 /sponsored-data-tutorials/simulator/ineligible-4 /sponsored-data-tutorials/simulator/ineligible-5 /sponsored-data-tutorials/simulator/ineligible-6 /sponsored-data-tutorials/simulator/ineligible-7
Internet Error Codes List Pdf
/sponsored-data-tutorials/simulator/ineligible-8 /sponsored-data-tutorials/simulator/ineligible-9 /sponsored-data-tutorials/examples /sponsored-data-tutorials/examples/tunnel /sponsored-data-tutorials/examples/video-download /sponsored-data-tutorials/examples/cdn /sponsored-data-tutorials/examples/ssl /sponsored-data-tutorials/examples/chunked /sponsored-data-tutorials/examples/management /sponsored-data-tutorials/examples/upload http://stackoverflow.com/questions/2892384/should-i-return-500-or-404-if-a-requested-image-is-not-found Site Optimized for Chrome and Firefox Site Optimized for Chrome and Firefox Site Optimized for Chrome and Firefox Site Optimized for Chrome http://developer.att.com/application-resource-optimizer/docs/best-practices/http-400-and-500-error-codes and Firefox Site Optimized for Chrome and Firefox The MMS API was deprecated on July 29, 2015. Get more information about our supported APIs. x /apis/sms-mms /apis/mms/docs The Device Capabilities API was deprecated on July 29, 2015. Get more information about our supported APIs. x /apis/device-capabilities /apis/device-capabilities/docs Sign In Download AT&T ARO AT&T Application Resource Optimizer Tour Docs Best Practices News Blog Forums /site/website/application-res
fix the error first. 5xx codes tell the client something happened on the server and their request by itself http://restcookbook.com/HTTP%20Methods/400-vs-500/ 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 http://security.stackexchange.com/questions/39139/are-500-responses-or-specific-error-codes-more-secure-for-rest-services 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 500 error 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 404 vs 500 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
tour help Tour Start 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 more about hiring developers or posting ads with us Information Security Questions Tags Users Badges Unanswered Ask Question _ Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Are 500 responses or specific error codes more secure for REST services? up vote 7 down vote favorite I am building a REST API to store security sensitive data for both my client and third-party partners. Each request is validated using an HMAC of certain data which is keyed on a temporary key assigned for a short duration after the user is logged in. Of course everything runs over TLS. Every request gets logged, along with the keys to any data returned, as well as the keys to any data that would have been returned if the request were not blocked for some reason. If the data is not present, or if the data at a location may be read by a particular user, but not updated, or if the update request is malformed, should the server return a meaningful error message, or not? If the user does not have permissions to perform an action, a 401 or 403 response should be returned, indicating that the request failed due to lack of permissions to perform the action. Other response codes may be used in the case where the data is malformed, or the expected data types do not match (sending a string to an int field, etc.). Basically, follow good REST/HTTP practices and log everything, but don't provide any information to the user beyond a basic hint as to what went wrong. Never give anyone any information, in case it could be used against the system in some way. Only ever return a 500 error, with no description of any kind. There is some level of disagreement as whether or not to even return a 404, or if an empty response or 500 error should be returned instead. If a third-party developer is encountering these responses, and doesn't understand why, they must contact our company, have someone lo