RestSharp HttpBasicAuthentication – example

new SimpleAuthenticator("username", username, "password", password) did NOT work with me.

The following however worked:

var client = new RestClient("http://example.com");
client.Authenticator = new HttpBasicAuthenticator(userName, password);

var request = new RestRequest("resource", Method.GET);
client.Execute(request);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)