Reputation: 24297
@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?
Upvotes: 2
Views: 597
Reputation: 24297
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
Upvotes: 4