Forum Discussion
If GET works but POST does not, there may be something wrong with the request variables in the script. Make sure the code in your script generating the request variables (request_vars) matches the code in the example.
You can add a line to the relevant section of the script to inspect the request variables in the Postman console:
// If the request includes a payload, included it in the request variables var request_vars = (http_verb == 'GET'||http_verb == 'DELETE') ? http_verb + epoch + resource_path : http_verb + epoch + request.data + resource_path; console.log(request_vars)
After saving the change to the pre-request script, open the Postman console then send the request.
request_vars for a GET request is just GET+timestamp+resource_path like this:
GET1553268441890/device/groups
request_vars for a POST request must include the body data between the timestamp and the resource path and so should look like this:
POST1553267947762{"name":"Postman"}/device/groups
I hope this helps. If not, feel free to share your POST request and I'll be happy to take a look.
Related Content
- 2 years ago
- 7 months ago