Receiving The remote server returned an error: (403) Forbidden message

假如想象 提交于 2019-12-01 18:17:14

You might need to specify credentials

request.Credentials = CredentialCache.DefaultCredentials;

or you if you need to pass specific credentials pass:

request.Credentials = new NetworkCredentials("user", "password");

More information about NetworkdCredential Class

Have you tried setting the Credentials object on the request with proper authorization for the server you are trying to access? See System.Net.NetworkCredential.

Try checking on both production and dev iis the authentication methods for the application (iis manager -> click on the website->features view ->authentication).

Sounds like on the dev iis you have anonymous authentication enabled, and on production iis not. If you will not have anonymous auth enabled on production, you will probably need to set the request.Credentials as you can see above.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!