The remote server returned an error: (403) Forbidden

后端 未结 10 1411
半阙折子戏
半阙折子戏 2020-12-15 03:16

I\'ve written an app that has worked fine for months, in the last few days I\'ve been getting the error below on the installed version only.

If I run the source code

相关标签:
10条回答
  • 2020-12-15 03:58

    Its a permissions error. Your VS probably runs using an elevated account or different user account than the user using the installed version.

    It may be useful to check your IIS permissions and see what accounts have access to the resource you are accessing. Cross reference that with the account you use and the account the installed versions are using.

    0 讨论(0)
  • 2020-12-15 04:03

    Looks like problem is based on a server side.

    Im my case I worked with paypal server and neither of suggested answers helped, but http://forums.iis.net/t/1217360.aspx?HTTP+403+Forbidden+error

    I was facing this issue and just got the reply from Paypal technical. Add this will fix the 403 issue. HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
    req.UserAgent = "[any words that is more than 5 characters]";

    0 讨论(0)
  • 2020-12-15 04:04

    This probably won't help too many people, but this was my case: I was using the Jira Rest Api and was using my personal credentials (the ones I use to log into Jira). I had updated my Jira password but forgot to update them in my code. I got the 403 error, I tried updating my password in the code but still got the error.

    The solution: I tried logging into Jira (from their login page) and I had to enter the text to prove I wasn't a bot. After that I tried again from the code and it worked. Takeaway: The server may have locked you out.

    0 讨论(0)
  • 2020-12-15 04:05

    In my case I remembered that a hole in the firewall was created for this address some time ago, so I had to set useDefaultWebProxy="false" on the binding in the config file, as if the default was to use the proxy if useDefaultWebProxy is not specified.

    0 讨论(0)
  • 2020-12-15 04:07

    Setting:

    request.Referer = @"http://www.somesite.com/";
    

    and adding cookies than worked for me

    0 讨论(0)
  • 2020-12-15 04:10

    We should access the website using the name given in the certificate.

    0 讨论(0)
提交回复
热议问题