Question

@request.headers["Authorization"] = "Token token=#{auth_token}"
post "/verify"

When I puts @request.inspect the only headers I see are:

..."action_controller.instance"=>
#<VerificationsController:0x007fc5683ebd38 @_routes=nil, 
@_action_has_layout=true, 
@_headers={"Content-Type"=>"text/html"}...

Why is my authorization header not showing?

Was it helpful?

Solution

I ended up getting this to work:

headers = { 'Authorization' => "Token token=\"#{auth_token}\"" } 
json_body = {}
post "api/1.1/cartwheelregister/verify/answers", json_body, headers
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top