var client = new RestClient("https://api.example.com"); client.Authenticator = new HttpBasicAuthenticator("username", "password"); client.AddHandler("application/json", new JsonDeserializer());
var client = new RestClient("https://api.example.com"); client.AddHandler("application/json", new JsonDeserializer()); client.AddHandler("application/json", () => { return new CustomHeadersHandler("Custom-Header", "Custom-Value"); });
var client = new RestClient("https://api.example.com"); client.AddHandler("application/json", new JsonDeserializer()); client.AddHandler("application/json", () => { return new LoggingHandler(); });In this example, we're adding a LoggingHandler to the RestClient that logs all HTTP requests and responses sent and received by the RestClient. Package/library: RestSharp