http-status-codes


php - How do I resolve a HTTP 414 "Request URI too long" error?

Under Apache, the limit is a configurable value, LimitRequestLine. Change this value to something larger than its default of 8190 if you want to support a longer request URI. The value is in /etc/apa... Read More



java - How can I get the HTTP status code out of a ServletResponse in a ServletFilter?

First, you need to save the status code in an accessible place. The best to wrap the response with your implementation and keep it there: public class StatusExposingServletResponse extends HttpServle... Read More


rest - HTTP response code for POST when resource already exists

My feeling is 409 Conflict is the most appropriate, however, seldom seen in the wild of course: The request could not be completed due to a conflict with the current state of the resource. This co... Read More


c# - System.Net.WebException HTTP status code

Maybe something like this... try { // ... } catch (WebException ex) { if (ex.Status == WebExceptionStatus.ProtocolError) { var response = ex.Response as HttpWebResponse; i... Read More


HTTP 400 (bad request) for logical error, not malformed request syntax

Status 422 (RFC 4918, Section 11.2) comes to mind: The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type)... Read More


bash - Script to get the HTTP status code of a list of urls?

Curl has a specific option, --write-out, for this: $ curl -o /dev/null --silent --head --write-out '%{http_code}\n' <url> 200 -o /dev/null throws away the usual output --silent throws away the progr... Read More


rest - Create request with POST, which response codes 200 or 201 and content

I think atompub REST API is a great example of a restful service. See the snippet below from the atompub spec: POST /edit/ HTTP/1.1 Host: example.org User-Agent: Thingio/1.0 Authorization: Basic ZGFm... Read More


In Python, how do I use urllib to see if a website is 404 or 200?

The getcode() method (Added in python2.6) returns the HTTP status code that was sent with the response, or None if the URL is no HTTP URL. >>> a=urllib.urlopen('http://www.google.com/asdfsf') >>> a.g... Read More


HTTP status code for temporarily unavailable pages

I disagree to the selected answer. I would use the 503 code. According to the RFC for HTTP/1.1: 503 Service Unavailable The server is currently unable to handle the request due to a temporary overlo... Read More