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

后端 未结 3 537
生来不讨喜
生来不讨喜 2021-01-19 03:08

I am receiving \"The remote server returned an error: (403) Forbidden\" error message on the block of code below. Specifically this line is failing: var response =

3条回答
  •  悲哀的现实
    2021-01-19 03:57

    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

提交回复
热议问题