Rack::Request – how do I get all headers?

The HTTP headers are available in the Rack environment passed to your app: HTTP_ Variables: Variables corresponding to the client-supplied HTTP request headers (i.e., variables whose names begin with HTTP_). The presence or absence of these variables should correspond with the presence or absence of the appropriate HTTP header in the request. So the HTTP … Read more

What’s the proper way to set the Location header for an HTTP 201 response in a Java Servlet application

Just send the absolute path. The restriction to an absolute URI is a known defect in RFC 2616 and will be fixed in HTTPbis (see http://trac.tools.ietf.org/wg/httpbis/trac/ticket/185). Please note that RFC 7231 now includes relative URIs in the spec. See other answers for how to handle relative URIs.

Are character set names case-sensitive in HTTP?

[Here is the result of my research.] RFC 2616 clause 3.4 says the following: HTTP character sets are identified by case-insensitive tokens. The complete set of tokens is defined by the IANA Character Set registry [19]. charset = token The IANA Character Set registry is now maintained here. At the very top of this document … Read more

Appropriate HTTP status code for request specifying invalid Content-Encoding header?

As i’m reading it, 415 Unsupported Media Type sounds like the most appropriate. From RFC 2616: 10.4.16 415 Unsupported Media Type The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method. Yeah, the text part says “media … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)