Bloodbath API
Search…
Wrong format when sending my body over the REST API
If you're using the REST API, you must be careful about the format you sent the body to. It should be strict JSON.
1
# GOOD
2
"{\\"scheduled_for\\":\\"2021-05-25 15:35:41 -0500\\",\\"method\\":\\"post\\",\\"headers\\":{\\"Random-Header\\":\\"Something\\"},\\"body\\":\\"Random body\\",\\"endpoint\\":\\"<https://api.fake-site.com>\\"}"
3
4
# BAD
5
"{:scheduled_for=>2021-05-25 15:35:41.604712 -0500, :method=>:post, :headers=>{:\\"Random-Header\\"=>\\"Something\\"}, :body=>\\"Random body\\", :endpoint=>\\"<https://api.fake-site.com>\\"}"
Copied!
If the JSON can't be decoded by the Bloodbath API, it'll throw an error.
Last modified 28d ago
Copy link