So, I have a Sinatra application that receives XML via HTTP POST from another service. I want to check it locally. I have a test XML file that I send to the endpoint. It's good. I also set some headers as follows:
post '/', xml, 'HTTP_X_MY_AWESOME_HEADER' => "It value"
where xml
is an exact copy of plain XML that is sent to my endpoint. But the title that I pass as a parameter never shows up in the output.
Am I doing something wrong here? There are a lot of messages about it, but everyone is out of date.
I am using Rspec 2.8, Sinatra 1.3.2, Ruby 1.9.3-p0, Rack :: Test 0.6.1.
UPDATE 2012-01-28 11:37 : Obviously, I did not think when I asked this question. Sending headers with a request does not mean that I will return them back in response.
So, now the question arises: how to check the request headers without sending them back with the answer?
Ivan
source share