I am using Postman version 6.7.4 and newman version 4.4. It is a team license for pro. I have postman collection tests which are up and running through Newman and Jenkins. No issues. There are more than 50 assertions and 20 tests.
Recently I added one new request to this collection. This new request is perfectly working fine in postman collection. However it returns 301 while executing from command line or via Jenkins using newman.
The below code snippet is the curl equivalent of the postman collection request(copied from postman) which was added newly. This request always returns 200 while running from postman.
However whenever I run the same collection using newman this particular request always it returns status 301. All requests are working fine except this one.
My guess is newman is not recognizing the square bracket in the query params. However postman collection runner works fine.
[I have masked the host and other information]
curl -X GET
-H ‘Authorization: zyzzzz’
-H ‘Postman-Token: 123456’
-H ‘cache-control: no-cache’
-H ‘x-api-key: ggggg’
newman run collections/servicescollection.json -e collections/Qenv.json --ignore-redirects --reporter-junit-export results.xml --reporters cli,junit
Only one request (above) is always returning 301. It always returns 200 when running through postman collection.
Note: I tried replacing the brackets with url encoding characters such as %5B and %5D. Still seeing the same issue.
Please provide your input.