PowerShell – Automatically follow redirects

Welcome Forums General PowerShell Q&A PowerShell – Automatically follow redirects

Viewing 0 reply threads
  • Author
    • #222156
      Topics: 2
      Replies: 0
      Points: 12
      Rank: Member

      Hello everyone,

      To explain you the design, I’ve built an API for Amazon AMS. I export data automatically.

      I now have a problem with Automatically follow redirects. When I run my script via POSTMAN, I can download my data, because I could disable the Automatically follow redirects option in the POSTMAN software, so my GET request uses the HTTP 307 redirect.

      So I tried in powershell to do the same method:
      Here is my command line:

      $response = Invoke-RestMethod ‘https://advertising-api-eu.amazon.com/v2/reports/amzn1.clickXXXX/download’ -Method ‘GET’ -Headers $headers -MaximumRedirection 0

      But I have nothing, no data, I thought MaximumRedirection 0 allowed to do as in POSTMAN but I don’t understand anymore.

      Do you have ideas to help me?

      I give you in screenshot the POSTMAN parameter that allowed me to get what I want.


      Thank you in advance.

      • This topic was modified 1 month ago by Mlaugier67.
      • This topic was modified 1 month ago by Mlaugier67.
Viewing 0 reply threads
  • You must be logged in to reply to this topic.