jjzjj

HttpBasicAuthentication

全部标签

c# - RestSharp HttpBasicAuthentication - 示例

我有一个使用RestSharp和WEBAPI服务的WPF客户端。我尝试按如下方式使用HttpBasicAuthenticator:RestRequestlogin=newRestRequest("/api/users/login",Method.POST);varauthenticator=newHttpBasicAuthenticator("admin","22");authenticator.Authenticate(Client,login);IRestResponseresponse=Client.Execute(login);POST请求如下所示:POSThttp://loc