JSON in Multipart formatting issue

Hello everyone,

I’m attempting to send multipart data to an API, but the multipart data in this case contains a JSON Array, therefor a ton of quotation marks ( messing up the format in which the multipart data is processed within OB2). I’ve attempted to use backslashes to escape the quotation marks but it doesn’t make a difference and OB2 can’t read it. Is there any way around this?

Share your content and ask for help better!

I’m not at my PC right now, but I feel question the is worded fine for my issue. I’ll send my block when I get home.

BLOCK:HttpRequest
  url = "http://127.0.0.1"
  method = POST
  TYPE:MULTIPART
  "data" "{"something":"something else"}"
ENDBLOCK

As you can see the JSON formatted data isn’t being processed my OB2 because it detects the quotations marks, therefor closing the multipart.

You need to escape the double quotes

BLOCK:HttpRequest
  url = "http://127.0.0.1"
  method = POST
  TYPE:MULTIPART
  "data" "{\"something\":\"something else\"}"
ENDBLOCK