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
return HttpResponse(status=204)... Read More
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
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
Maybe something like this... try { // ... } catch (WebException ex) { if (ex.Status == WebExceptionStatus.ProtocolError) { var response = ex.Response as HttpWebResponse; i... Read More
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
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
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
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
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