简体   繁体   中英

Getting 403 when executing request from amazon server

Very same code works fine from other locations, but whenever is run from amazon server it gets 403.
We tried "everything":

  • checking with postman
  • copying cookies
  • copying / not copying the headers.

    whatever we do we get 403 when code / request is run from amazon server. What is even more interesting: browsers work fine (you can get to the same link from any browser without any errors). So the conclusion is like "something blocks requests that are not sent with the browser and we can't impersonate aby browser".

    thanks in advance!

PS as far what i know it's fine from some other hosting services, only Amazon seems to be blocked.
Requests are not passed from any app / any language, including Postman but they're fine when any browser is used. So it's like "something" detects the original source of request and if request comes from amz "it" blocks the request. Everything is fine when not used from amz servers)

You shouldn't use C# for web scraping, this language isn't designed to do that. You may consider using more flexible technology like Python which has several libraries for web scraping purposes, which will solve your trouble.

You can't use one language to do everything. C# may not be bad choice for Windows desktop apps, but you can't do anything else.

You can send your request to https://requestbin.com/ to analyze better what is going out from the Program and then change the missing parameters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM