City Pedia Web Search

Search results

  1. Results From The WOW.Com Content Network
  2. When to use HTTP status code 404 in an API

    softwareengineering.stackexchange.com/questions/203492

    I agree with your stand that you should get a status code that shows something went wrong. This is after all what status codes are for. Also you get the benefit of libraries that throw exceptions/etc. on non-200 status code so you do not have to check explicitly (Or you can write your own wrapper that does this).

  3. Should I return a 204 or a 404 response when a resource is not...

    softwareengineering.stackexchange.com/questions/322951

    Instead, you should throw new NotFoundException(); to indicate to the framework that the entry doesn't exist, so that it would generate a HTTP 404. If I should change it to a 404, obvious question: I should change the method signature right? No, you don't. That's the nice thing about throw new NotFoundException();. It will work no matter what ...

  4. rest - What is a proper response status code to POST when parent...

    softwareengineering.stackexchange.com/questions/364590/what-is-a-proper...

    This code usually makes web browsers to redirect to a specific location (URI) informed in the response headers. This might not be your case, but it's important to know about this. Ultimately, HTTP status codes are addressed to HTTP clients. Not to our applications. Not to persons.

  5. Rest API POST with illegal data in parameters: Bad Request or...

    softwareengineering.stackexchange.com/questions/394419

    Unlike 404, 400 means "ok, the resource does exist, the request has been handled but could not be processed because something is missing, wrong-formated or the content doesn't make sense. Fix the issues and try again". Remember that HTTP status codes are always addressed to HTTP clients, not to the business, not the application.

  6. Should "No Results" be an error in a RESTful response?

    softwareengineering.stackexchange.com/questions/358243

    Always decide which range your response code should be in first. Doing so quickly eliminates a lot of response codes as options, and (maybe more importantly) it makes following the semantics of the codes much simpler. See the beginning sections of the HTTP code documentation for the explanations of what each category of codes represents.

  7. HTTP status 500 for missing file - Software Engineering Stack...

    softwareengineering.stackexchange.com/questions/388925

    1. 404 is a client asking (or guessing) for something nobody knows if it exists. The server looks for it and it does not fail at searching. it just doesn't find it. 500 is the server failing at searching/serving the file due to a crash that was not meant to happens. – Laiv.

  8. security - Which http response do you return to a hit from a ...

    softwareengineering.stackexchange.com/questions/21339/which-http-response-do...

    I like 403, or 404, leaning toward 404. 403 might encourage them to try different tactics. 404 implies the page just isn't there at all and it's a bad URL. I've written a lot of spiders for past jobs, and seldom saw 403, but ran into lots of 404s. Either way my code would remove the URL from the queue, but that's because I was trying to play fair.

  9. "Invalid operation" status code in a HATEOAS REST API

    softwareengineering.stackexchange.com/questions/141951

    404 Not Found; The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.

  10. api - What should be the http status code for "Service not...

    softwareengineering.stackexchange.com/questions/374031/what-should-be-the-http...

    HTTP status codes are extensible. HTTP applications are not required to understand the meaning of all registered status codes, though such understanding is obviously desirable. However, applications MUST understand the class of any status code, as indicated by the first digit, and treat any unrecognized response as being equivalent to the x00 ...

  11. api design - Should I return an HTTP 400 (Bad Request) status if...

    softwareengineering.stackexchange.com/questions/329229/should-i-return-an-http...

    The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions.