I'm working on a simple API with Sinatra and I have a route like this one:
get '/api/v1/invoice/:biller', :provides => [:json] do
respond_with invoice( request )
end
It works like a charm when I don't send any header params, but when I send:
- Accept
- Content-Type
Then I got a 404 Not Found
error and the classic Sinatra error 'Sinatra doesn't know this ditty'.
How can I validate specific header params on Sinatra?
Edit
This is the actual header (Accept) with a curl example:
curl -H "Accept: application/vnd.tpago.billpayment+json" -X GET "http://localhost:3540/api/v1/invoice/5947647"
Thanks!