c# - How to read an intranet site using HttpClient -
i trying access intranet site format https://foo
@ work using httpclient
. have below code:
var header = new authenticationheadervalue("basic", convert.tobase64string (system.text.encoding.utf8.getbytes (string.format("{0}:{1}", "username", "password")))); client.defaultrequestheaders.authorization = header; var result = await client.getstringasync(resourceuri);
what need make work? have tried encrypting password using md5 no luck. program quietly exits after getstringasync call got no result.
Comments
Post a Comment