Passing NetworkCredential to HttpWebRequest in C# from ASP.Net Page

前端 未结 3 1345
滥情空心
滥情空心 2020-12-11 05:08

I\'m trying to use HTTPWebRequest to access a web service, and am having problems passing credentials in, see code below. I can see the credentials object, nc, being built i

3条回答
  •  遥遥无期
    2020-12-11 05:12

    It helped me (for Unity3d mono, not ASP.Net):

    request.PreAuthenticate = true;
    

    Do not need manual set Authorization header or use CredentialCache.

提交回复
热议问题