Closed angelacode closed 9 years ago
Howdy!
Something like this:
response = CurbFu.post({ :url => url, :headers => { 'Content-Type' => 'application/json' } }, payload)
should work!
thank you trying it now...!
hm, this is what I tried prior...and it didn't work....trying again...
I still get the same error:
HTTP Status 400 - Bad Request
But curl works:
curl "https://api-sandbox.billforward.net:443/v1/subscriptions/SUB-35F07614-4F6D-4AF2-95EB-F3DB03FE/advance" \
-H "Authorization: Bearer token-here" \
-H "Content-Type: application/json" \
-d \
'{
"to": "2015-11-22T19:26:15Z",
"skipIntermediatePeriods": true,
"handleAmendments": false
}'
This is what I tried:
response = CurbFu.post({ :url => url, :headers => { 'Content-Type' => 'application/json', 'Authorization' => "Bearer #{token}" } }, payload_json)
I believe this is the same as what you did and I still get a bad formed request....
seeing that the format of the raw JSON isn't the same as when using curl....
This is what I did based on the documentation:
But it's expecting a hash....