Use this tag for issues with pre-request scripts in postman, use the "postman" tag for general issues
Questions tagged [postman-pre-request-script]
319 questions
0
votes
0 answers
How can I call a api paralleled at the same time with postman? How could I do it?
I am using postman and want to test a restful api with calling it at the same time, which same time api trigger at the same time. So i can check what happen if the same records posted in a db.
Could anyone help ?
Thank you very much.

fizz
- 69
- 1
- 9
0
votes
2 answers
how to set hash in Postman Pre-Request Script for Marvel API
I have a pre-request script that I gathered from another post on StackOverflow, but I'm still getting invalid credentials.
Attempted to do this just with str_1 but it's not working. Not sure what request.data is supposed to do as it keeps returning…

thinker
- 167
- 3
- 10
0
votes
2 answers
Trying to get two postman.setNextRequest (not chained) or two Actions in Workspace
I’m quite new to postman (and coding) and was trying to find and piece together many snippets of scripts to make it work the way I want.
What I want is very simple: I have a list of IDs that I want to make a POST in each of them, get one of the…
0
votes
1 answer
Postman pre-request script iterate over request body JSON
I am sending raw POST request with application/json data to server in Postman. I need to work with this JSON object and append some data in pre-request script. However I can only find how to access environmental variables, not request body. Anybody…

michnovka
- 2,880
- 3
- 26
- 58
0
votes
2 answers
In a Postman pre-request-script, how can I read the actual value of a header that uses a variable
I have a variable called token with a specific value myTokenValue
I try to make a call that includes that variable in a header, tokenHeader:{{token}}
I also have a pre-request-script that needs to change the request based on the value of the token…

neXus
- 2,005
- 3
- 29
- 53
0
votes
1 answer
Retrieve JSON POST Parameters in express node
this is the first time I am using node js. I am sending post request through Postman. The problem is I am unable to get these params. It says undefined or empty
This is what I have tried so far
var express = require("express");
var app =…

user1hjgjhgjhggjhg
- 1,237
- 4
- 15
- 34
0
votes
2 answers
How to read dynamic request parameter value in postman?
I pass some a random integer in the value of a parameter in the request body -
"trans_id":"7q498992029699{{$randomInt}}"
What is the best way to get the final value of trans_id param in the Tests tab?
As per my observation, using {{$randomInt}}…

Sandeepan Nath
- 9,966
- 17
- 86
- 144
0
votes
3 answers
Not able to get value from postman response body
I have an API which has response as below:
"message": "Success!",
"user": {
"id": 17,
"first_name_kanji_or_hiragana": "Hiragana",
"last_name_kanji_or_hiragana": "Name",
"first_name_katakana": null,
…

Sumaiya
- 23
- 2
- 5
0
votes
1 answer
Postman - set variables for individual requests before collection pre-request script runs
I want to make a Postman collection of requests hitting the same API endpoints as different users. For example:
login "user_1"
set data
login "user_2"
get data & check correct
I could make the login request a separate request, so the example…

Tom H.
- 480
- 3
- 16
0
votes
1 answer
Run prerequest script to stringify body of the request
I am using post man to send a post request with the body as form-data which contains files and text. See the image below:
I want to json.stringify the entire body but I cannot work out how to do this in a pre-request script. As an environment…

Anton James
- 385
- 3
- 6
- 18
0
votes
2 answers
Postman post pre-request failing on https
I'm trying to setup a Postman Pre-request to get an OAuth token before each request I make to my service.
I've tried to follow various examples and guides related to this and each seems pretty straightforward, though I still have issues with my…

Kerruba
- 1,779
- 1
- 17
- 25
0
votes
0 answers
Data Files in PR-request_Result is showing as undefined
Problem statement:- I am trying to use data variables in pre-request section and I am unable to retrieve values from CSV data variable. I tried using the below two options but still no data is seen when I try to log the value nothing is displayed;
-…

JACOB SAMUEL
- 3
- 1
- 4
0
votes
1 answer
POSTMAN- Generate Request body dynamically using Data Files to pass values for certain fields
How can I generate this payload automatically in postman. Please see the structure below.
I am only changing Account Number / Account Name in the payload. If I have add 200 accounts for a customer ID I would have to insert 200 separate structures in…

JACOB SAMUEL
- 3
- 1
- 4
-1
votes
1 answer
Why can't I put my base64 string in my form-data
I'm trying to create a postman prerequisite script to upload a file to our API using a form data
My body is given below.
Now, the problem is that if put my base64 string in the value field where the key is "file" our API still returns an error where…

MagsTester
- 35
- 1
- 1
- 3
-1
votes
1 answer
How can we SELECT one or more Cosmos documents using Postman?
Out of morbid curiosity, how can a document be retrieved by directly exercising the Cosmos REST API? For my use case I would like to see it done within Postman.

Nicholas Hill
- 306
- 2
- 18