I am not sure I understand your question, but how does the headers hash look like? maybe if you show me the result will be easier to understand the mistake!
Also gives a concrete example of which headers you trying to set.
I have always done curl requests like this:
curl -i --header "Accept: application/json" --header "Content-Type: application/json"
the -i option from the manual:
-i, --include
(HTTP) Include the HTTP-header in the output. The HTTP-header includes things like server-
name, date of the document, HTTP-version and more...
so you can see the answer to your curl call.