I am sending the following request using jQuery
var url = 'http://site.local/api/package/create';
var data = {
"command": "package",
"commandParameters": {
"options": [
{
"a": true
}
],
"parameters": {
"node_id": 1111,
"node_name": "Node Name"
}
}
}
$.ajax({
url: url,
type: "POST",
data: JSON.stringify(data),
contentType: "application/json",
success: function (a, b, c) {
// Do something with response
}
});
Also doing something similar using Postman (Chrome plugin)
POST
Content-Type: application/json
Payload:
{
"command": "package",
"commandParameters": {
"options": [
{
"a": true
}
],
"parameters": {
"node_id": 1111,
"node_name": "Node Name"
}
}
}
It is intended that I send a raw JSON string to my server, rather than have Jquery convert it to post data. How do I perform the same in Codeception, I just can't see it in the documentation, I only see the following..
$I->sendAjaxPostRequest('/updateSettings', array('notifications' => true));
So I guess I want to make a POST request in Codeception, while attaching JSON in the body of the request?