- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 10:18 AM
I simply want to send a POST message to a server. I have a GET working from that same server already on SNOW.
I just can't figure out how to send the request body.
For instance I want to mimic this curl statement
curl -H "Content-Type: application/json" -X POST -d '{"title":"hi"}' http://live_server:5000/api/v1/incident
Where do I enter the {"title":"hi"}?
This image shows the UI that I am dealing with, it looks different from the tutorial UI's so I am having trouble using them.
I cannot find the Request Body field
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 01:53 PM
You need to send a string in the request body.
Change these two...
var body = {"title":"hi"};
r.setRequestBody(body);
To this:
var body = '{"title":"hi"}';
r.setRequestBody(body);
or
var body = {"title":"hi"};
var bodyText = JSON.stringify(body);
r.setRequestBody(bodyText);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2017 01:53 PM
You need to send a string in the request body.
Change these two...
var body = {"title":"hi"};
r.setRequestBody(body);
To this:
var body = '{"title":"hi"}';
r.setRequestBody(body);
or
var body = {"title":"hi"};
var bodyText = JSON.stringify(body);
r.setRequestBody(bodyText);