http
Do colons require encoding in URI query parameters?
Yes, they should be encoded in a query string. The correct encoding is %3A However, I can understand why UriBuilder isn’t encoding :. You don’t want to encode the colon after the protocol (eg http:) or between the username and password (eg ftp://username:[email protected]) in an absolute URI.
HTTP status code when single request asks for too large resource or too many of them
403 sounds like the most appropriate choice. It basically says “nu-uh. You don’t get to see that.”, which is pretty much the case here. 10.4.4 403 Forbidden The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. […] Of course, it’d be a … Read more
Using port 80 with IIS Express inside of VS2010
Just posting my own answer for this problem so I can mark the question as answered. Check http://learn.iis.net/page.aspx/1005/handling-url-binding-failures-in-iis-express/ Disable the Web Deploy Agent service if you have it installed.
Proper HTTP headers for login success / fail responses?
The header that the server sends is either the 200 OK or 401 denied status codes on success or failure. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Section 10.4.2 401 Unauthorized for this. When sending the 401, the server must send a WWW-Authenticate = “WWW-Authenticate” “:” 1#challenge to indicate what scheme should be used to authenticate. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html Section 14.47 … Read more
HTTP Status Code for Resource not yet available
409 Conflict The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough information for the user to … Read more
Which HTTP status code to return when the DELETE operation is not allowed for particular reason
I would go with 409: Conflict, because what you have is a violation of resource state. 405: Method Not Allowed would also work. If you’d want to use a 405, you’d have to send an Allow header to indicate the supported methods, and the supported methods would vary depeding on the resource’s state. In my … Read more
“Age: 0” HTTP Header
See the HTTP 1.1 specification on what the Age header field is intended to be used for: The Age response-header field conveys the sender’s estimate of the amount of time since the response (or its revalidation) was generated at the origin server. This information is used by intermediate proxies to convey an estimate of how … Read more
How to run CGI “hello world” with python http.server
From the http.server docs: CGIHTTPRequestHandler can be enabled in the command line by passing the –cgi option: $ python3 -m http.server –bind localhost –cgi 8000 Put your script into cgi_directories: This defaults to [‘/cgi-bin’, ‘/htbin’] and describes directories to treat as containing CGI scripts. Open in the browser: $ python -mwebbrowser http://localhost:8000/cgi-bin/hello.py where hello.py: #!/usr/bin/env … Read more