Skip to content

Instantly share code, notes, and snippets.

@tongueroo
Last active November 4, 2018 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tongueroo/94f22f6c261c8999e4f4f776547e2ee3 to your computer and use it in GitHub Desktop.
Save tongueroo/94f22f6c261c8999e4f4f776547e2ee3 to your computer and use it in GitHub Desktop.
$ curl -H 'accept-encoding: gzip, deflate, br' localhost:8080/posts
Started GET "/posts" for 127.0.0.1 at 2018-11-04 13:17:23 +0000
Processing by PostsController#index as */*
Rendering posts/index.html.erb within layouts/application
request.class ActionDispatch::Request
SCRIPT_NAME:
QUERY_STRING:
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: puma 3.12.0 Llamas in Pajamas
GATEWAY_INTERFACE: CGI/1.2
REQUEST_METHOD: GET
REQUEST_PATH: /posts
REQUEST_URI: /posts
HTTP_VERSION: HTTP/1.1
HTTP_HOST: localhost:8080
HTTP_USER_AGENT: curl/7.53.1
HTTP_ACCEPT: */*
HTTP_ACCEPT_ENCODING: gzip, deflate, br
SERVER_NAME: localhost
SERVER_PORT: 8080
PATH_INFO: /posts
REMOTE_ADDR: 127.0.0.1
rack.url_scheme: http
action_dispatch.secret_key_base: a8e9f9e41cf9f4ace56abc1f84a22fd1
action_dispatch.http_auth_salt: http authentication
action_dispatch.signed_cookie_salt: signed cookie
action_dispatch.encrypted_cookie_salt: encrypted cookie
action_dispatch.encrypted_signed_cookie_salt: signed encrypted cookie
action_dispatch.authenticated_encrypted_cookie_salt: authenticated encrypted cookie
ROUTES_47353250709780_SCRIPT_NAME:
ORIGINAL_FULLPATH: /posts
ORIGINAL_SCRIPT_NAME:
action_dispatch.request_id: 8761c15a-86f5-4eec-aed9-512ff7455db3
rack.request.query_string:
Post Load (0.2ms) SELECT "posts".* FROM "posts"
↳ app/views/posts/index.html.erb:15
Rendered posts/index.html.erb within layouts/application (1.5ms)
Completed 200 OK in 19ms (Views: 15.5ms | ActiveRecord: 0.2ms)
module PostsHelper
def foobar
puts "request.class #{request.class}" # ActionDispatch::Request
request.headers.each do |k,v|
if v.is_a?(String)
puts "#{k}: #{v}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment