403 forbidden when posting to a url

Lor*_*000 0 c# post http-status-code-403

I am posting a request to a website:

request = (HttpWebRequest)WebRequest.Create("https://www.footlocker.dk/api/users/carts/current/entries?timestamp=1611595223668");

request.Method = "POST";

using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
  string json = "{\"user\":\"test\"," + "\"password\":\"bla\"}";

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)request.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
  {
    var result = streamReader.ReadToEnd();
  }
Run Code Online (Sandbox Code Playgroud)

When I submit this request, I am getting a 403 forbidden, with following html:

<html>
  <head>
    <title>footlocker.dk</title>
    <style>
      #cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}
    </style>
  </head>
  <body style="margin:0">
    <p id="cmsg">Please enable JS and disable any ad blocker</p>
    <script>
      var dd={'cid':'AHrlqAAAAAMA2k9UvgFgVkIAk04eSQ==','hsh':'A55FBF4311ED6F1BF9911EB71931D5','t':'fe','r':'b','s':17434,'host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js">
   </script>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

Are there anyway I can make the browser think that JS is enabled?

小智 5

你为什么要提出这个要求?根据Footlocker 服务条款

未经Foot Locker事先书面许可,您不得使用任何计算机代码、数据挖掘软件、“机器人”、“机器人”、“蜘蛛”、“刮刀”或其他自动设备,或具有类似过程的程序、算法或方法或功能,或任何手动过程,以监控或复制在本网站或应用程序上找到或通过本网站或应用程序访问的任何网页、数据或内容。

我假设您正试图对本网站进行未经授权的抓取/监控,我强烈建议您停止,因为这违反了上述条款和条件。