Verify pre-request script prepares data correctly before API call
Preconditions (3)
Step 1: Open the Postman collection and select the API request
Step 2: Go to the Pre-request Script tab
Step 3: Write a script that generates a token and saves it to an environment variable 'authToken'
Step 4: Go to the Headers tab and add 'Authorization' header with value 'Bearer {{authToken}}'
Step 5: Send the API request
Step 6: Observe the request headers and response
✅ Expected Result: The API request includes the Authorization header with the token generated by the pre-request script, and the API responds successfully using the prepared data