How to add full Post Raw Body within a Collection Variable to use in the next api call?
I have the POST body parameters:
{
"announcementId": 0,
"header": "Delete Testing slide through API - Header - SS -Time Lapsed should not display",
"body": "Delete Testing slide through API - Body - SS Time Lapsed should not display",
"announcementType": 0,
"imageUrl": "",
"updateDate": "2020-09-22T23:24:10.382Z",
"isAlertBanner": true,
"startDate": "2020-08-29T02:21:22.382Z",
"endDate": "2020-09-20T23:24:10.382Z",
"enabled": true,
"sortOrder": 1
}
And i want to add all the values within a collection or environment variable to i can verify after clicking on send, that that is the response that i get in API 2
this is what i got:
let header = JSON.parse(pm.request.body.raw).header;
pm.environment.set(‘header’,header);
this works for one element within the POST but i want the whole thing.