delpha delpha - 6 months ago 8
Ruby Question

Display or get the HTTP header attributes in Rails 4

I have an application developed in Rails and I am trying to see the attributes in the HTTP header.

Is there any way to read these attributes? Where are they stored?

Someone mentioned

request.headers
. Is this correct? I am not able to see any attributes inside this array.

Answer

This code solved my question request.env["HTTP_MY_HEADER"]. The trick was that I had to prefix my header's name with HTTP