Bloodbath API
  • Bloodbath API
  • Getting started
    • Acquire your API key
    • Schedule your first event
    • Being on the beta release
  • API
    • Working with REST
    • Working with GraphQL
  • Open source libraries
  • Ruby
  • Python
  • Node
  • FAQ
    • What protocols can be used?
    • What's the maximum payload size?
    • What's the correct format to build headers?
    • Wrong format when sending my body over the REST API
Powered by GitBook
On this page

Was this helpful?

  1. FAQ

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.

# GOOD
"{\\"scheduled_for\\":\\"2021-05-25 15:35:41 -0500\\",\\"method\\":\\"post\\",\\"headers\\":{\\"Random-Header\\":\\"Something\\"},\\"body\\":\\"Random body\\",\\"endpoint\\":\\"<https://api.fake-site.com>\\"}"

# BAD
"{: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>\\"}"

If the JSON can't be decoded by the Bloodbath API, it'll throw an error.

PreviousWhat's the correct format to build headers?

Last updated 3 years ago

Was this helpful?