Search code examples
node.jsexpressrunscope

Runscope – How can I send a JSON body with my POST request?


I'm using Runscope to test my Node/Express app and I can't figure out how to send a JSON Body via a POST request in Runscope. Everything I've tried can't be parsed by the express bodyParser. The JSON I'm want to send looks like this:

{ "variable1":"value1",
  "variable2": {
      "variable3": "value2"
  }
}

Solution

  • I tried the request with your JSON body and it seems to work for me against an "echo" API. I have created a shared request so you can see what the request looks like here.

    Try this,

    • Go to the Traffic Inspector, and click "New Request". That will take you to the Request Editor.
    • Select POST instead of GET and enter the URL of your node express app.
    • Click on "Add Json" and add your JSON data in the "Request Data" field.
    • Click Launch Request.