简体   繁体   English

从亚马逊服务器执行请求时获取 403

[英]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.非常相同的代码在其他位置运行良好,但无论何时从亚马逊服务器运行,它都会得到 403。
We tried "everything":我们尝试了“一切”:

  • checking with postman与 postman 检查
  • copying cookies复制 cookies
  • copying / not copying the headers.复制/不复制标题。

    whatever we do we get 403 when code / request is run from amazon server.无论我们做什么,当代码/请求从亚马逊服务器运行时,我们都会得到 403。 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. PS 据我所知,其他一些托管服务还不错,只有亚马逊似乎被屏蔽了。
Requests are not passed from any app / any language, including Postman but they're fine when any browser is used.请求不会从任何应用程序/任何语言(包括 Postman)传递,但在使用任何浏览器时都可以。 So it's like "something" detects the original source of request and if request comes from amz "it" blocks the request.所以这就像“某物”检测到请求的原始来源,如果请求来自 amz,“它”会阻止该请求。 Everything is fine when not used from amz servers)不从 amz 服务器使用时一切都很好)

You shouldn't use C# for web scraping, this language isn't designed to do that.您不应该使用 C# 进行 web 抓取,这种语言不是为此而设计的。 You may consider using more flexible technology like Python which has several libraries for web scraping purposes, which will solve your trouble.您可以考虑使用更灵活的技术,例如 Python,它有几个用于 web 抓取目的的库,这将解决您的麻烦。

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. C# 对于 Windows 桌面应用程序来说可能是不错的选择,但您无能为力。

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.您可以将您的请求发送到https://requestbin.com/以更好地分析程序输出的内容,然后更改缺少的参数。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 第二次收到相同请求的403禁止访问 - Getting 403 Forbidden for the same request to server in second time C# WebClient 从站点获取 html 时收到 403 - C# WebClient receives 403 when getting html from a site 在 C# 中使用 SFTP 将 MemoryStream 从 Amazon S3 存储桶发送到远程服务器时获取“无效路径” - Getting "Invalid path" when sending MemoryStream from Amazon S3 bucket to a remote server using SFTP in C# 没有从 rcon 请求中获得对服务器的完整响应 - Not getting a full response from a rcon request to a server Azure 存储:403 服务器无法对请求进行身份验证 - Azure Storage: 403 Server failed to authenticate the request 获取错误“使用HttpWebRequest.GetResponse()进行屏幕抓取时,远程服务器返回错误:(403)禁止” - Getting Error “The remote server returned an error: (403) Forbidden” when screen scraping using HttpWebRequest.GetResponse() 获取Facebook访问令牌时偶尔出现403 - Occasional 403 when getting Facebook access token 尝试使用 ExchangeService 从 Office 365 邮箱获取文件夹项目时出现 403 错误 - Getting 403 error when trying to get Folder items from Office 365 mailbox using ExchangeService 获取访问令牌被禁止403和有时是400错误的请求 - getting access tokens forbidden 403 and some times 400 Bad Request 在 C# 中执行 SQL 服务器存储过程时获取 null 值 - Getting null Value when executing a SQL Server stored procedure in C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM