Simple REST and HTTP API Client for .NET

View the Project on GitHub restsharp/RestSharp

NEED HELP with RestSharp?

Post your question on StackOverflow. If you think you've found a bug, create an issue on GitHub.

Pull requests gladly accepted, but if it's a big change you should discuss it with the group first to make sure it fits into the goals and plans of the project.

Contribution Guidelines


Contributors and Acknowledgements

Important change in version 103.0.0

Version 103 removed JSON.NET as a dependency. Please read this and this.


var client = new RestClient("");
// client.Authenticator = new HttpBasicAuthenticator(username, password);

var request = new RestRequest("resource/{id}", Method.POST);
request.AddParameter("name", "value"); // adds to POST or URL querystring based on Method
request.AddUrlSegment("id", 123); // replaces matching token in request.Resource

// easily add HTTP Headers
request.AddHeader("header", "value");

// add files to upload (works with compatible verbs)

// execute the request
RestResponse response = client.Execute(request);
var content = response.Content; // raw content as string

// or automatically deserialize result
// return content type is sniffed but can be explicitly set via RestClient.AddHandler();
RestResponse<Person> response2 = client.Execute<Person>(request);
var name = response2.Data.Name;

// easy async support
client.ExecuteAsync(request, response => {

// async with deserialization
var asyncHandle = client.ExecuteAsync<Person>(request, response => {

// abort the request on demand

The Latest