Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.
Here’s an outline with best practices for making your inquiry.
I have a GET request endpoint that receives a response in json format. The response-json structure changes based on config in host. I want to copy-paste this response in the body of a POST request to be able to edit the field values and then send it to the same host as an updated configuration.
There are several blogs with similar question but they all suggest assigning GET response to an environment variable and then in POST body, use that environment variable. I cannot use this approach because I need to see the full json in the POST request body to view current values and do necessary edits.
Also, since the json format changes based on the configuration on a device, I guess I cannot edit json in pre-script or tests.
Ideal thing would be to send a GET request (“Read Resource”), and somehow in the GET Tests, load the response in the body of POST request (“Write Resource”). So, whenever I click on POST request, the body is already populated with new json from the recent GET request.
Details (like screenshots):
How I found the problem:
New collection development.
I’ve already tried:
Copying response in environment variable and use that as body in the POST request. Need to see full json structure in the body of the POST request to be able to edit it.