BasicAuth memo

string authInfo = userName + ":" + userPassword;
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
request.Headers["Authorization"] = "Basic " + authInfo;

posted @ 2017-05-26 09:14  dunkbird  阅读(110)  评论(0编辑  收藏  举报