Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API scripts via Newman are failing with 403 error #2936

Open
vikaschoudhary89 opened this issue Feb 23, 2022 · 1 comment
Open

API scripts via Newman are failing with 403 error #2936

vikaschoudhary89 opened this issue Feb 23, 2022 · 1 comment

Comments

@vikaschoudhary89
Copy link

  1. Newman Version (can be found via newman -v): 5.3.1
  2. OS details (type, version, and architecture): Windows 10
  3. Are you using Newman as a library, or via the CLI? : CLI
  4. Did you encounter this recently, or has this bug always been there: Started testing now
  5. Expected behaviour: Should work as same when We run through Postman
  6. Command / script used to run Newman: newman run [File].json -e [Environment].json
  7. Sample collection, and auxiliary files (minus the sensitive details):
  8. Screenshots (if applicable): attached
    Newman_403Error
    Postman_setting

Steps to reproduce the problem:

  1. I already have proxy created in environment variable but when I use those proxy in Postman I get same error 403 forbidden
  2. So unchecking those proxy in postman, makes my API scripts work in postman
  3. trying to run the same scripts via newman but it is failing with 403 error, not sure how to run this API test as I can't remove those proxy (needed for other projects)
@ThierryRassat
Copy link

I have a request ok in Postman(code 201) with user-agent = PostmanRuntime/7.43.0.

I export it to used with cURL. cURL request is ok to0(code 201) with user-agent = PostmanRuntime/7.43.0.
I remove user-agent in my request and my result now is http 403 error.

Then I want to use newman. So I export collection from Postman.
The user-agent is in json export only if I had manually in Postman Request.
So, I try to use my request with newman and the result is : http 403 error.

So I think that newman not use
{
"key": "User-Agent",
"value": "PostmanRuntime/7.43.0"
} in header json collection

Can you tell me if it's or not ?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@DannyDainton @vikaschoudhary89 @ThierryRassat and others