Variables In Request Env - Ruby on Rails
request.env is a Ruby Array that contains information about a visiting user’s and server environments.request.env is accessible on all pages hosted in a ruby on rails site. The Array contains the following key/value pairs:
- SERVER_NAME
- PATH_INFO
- REMOTE_HOST
- HTTP_ACCEPT_ENCODING
- HTTP_USER_AGENT
- SERVER_PROTOCOL
- HTTP_CACHE_CONTROL
- HTTP_ACCEPT_LANGUAGE
- HTTP_HOST
- REMOTE_ADDR
- SERVER_SOFTWARE
- HTTP_KEEP_ALIVE
- HTTP_REFERER
- HTTP_COOKIE
- HTTP_ACCEPT_CHARSET
- REQUEST_URI
- SERVER_PORT
- GATEWAY_INTERFACE
- QUERY_STRING
- REMOTE_USER
- HTTP_ACCEPT
- REQUEST_METHOD
- HTTP_CONNECTION
For testing purposes it might be useful to print out a table with the request.env information in it.
| key | Value |
|---|---|
| <%= item[0] %> | <%= item[1] %> |
- Add new comment
- 4378 reads
- Feed: blogofchirag
- Original article


Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago