GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - arch/RestSharp: Simple REST and HTTP API Client for .NET

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

1,224 Commits
1,224 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.nuget
.nuget
 
 
RestSharp.Android
RestSharp.Android
 
 
RestSharp.Build
RestSharp.Build
 
 
RestSharp.IntegrationTests
RestSharp.IntegrationTests
 
 
RestSharp.Tests
RestSharp.Tests
 
 
RestSharp.UWP
RestSharp.UWP
 
 
RestSharp.iOS
RestSharp.iOS
 
 
RestSharp
RestSharp
 
 
Tools
Tools
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
RestSharp.sln
RestSharp.sln
 
 
RestSharp.snk
RestSharp.snk
 
 
appveyor.yml
appveyor.yml
 
 
build.bat
build.bat
 
 
readme.txt
readme.txt
 
 
releasenotes.md
releasenotes.md
 
 
restsharp.nuspec
restsharp.nuspec
 
 

Repository files navigation

RestSharp - Simple .NET REST Client

Build status

Join the chat at https://gitter.im/RestSharp/RestSharp

Official Site - @RestSharp

License: Apache License 2.0

Features

  • Supports .NET 3.5+, Mono, Mono for Android, UWP
  • Easy installation using NuGet for most .NET flavors
  • Supports strong naming using NuGet for most .NET flavors
  • Automatic XML and JSON deserialization
  • Supports custom serialization and deserialization via ISerializer and IDeserializer
  • Fuzzy element name matching ('product_id' in XML/JSON will match C# property named 'ProductId')
  • Automatic detection of type of content returned
  • GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE supported
  • Other non-standard HTTP methods also supported
  • OAuth 1, OAuth 2, Basic, NTLM and Parameter-based Authenticators included
  • Supports custom authentication schemes via IAuthenticator
  • Multi-part form/file uploads
  • T4 Helper to generate C# classes from an XML document
var client = new RestClient("http://example.com");
// 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

// add parameters for all properties on an object
request.AddObject(object);

// or just whitelisted properties
request.AddObject(object, "PersonId", "Name", ...);

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

// add files to upload (works with compatible verbs)
request.AddFile("file", path);

// execute the request
IRestResponse 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();
IRestResponse<Person> response2 = client.Execute<Person>(request);
var name = response2.Data.Name;

// or download and save file to disk
client.DownloadData(request).SaveAs(path);

// easy async support
client.ExecuteAsync(request, response => {
    Console.WriteLine(response.Content);
});

// async with deserialization
var asyncHandle = client.ExecuteAsync<Person>(request, response => {
    Console.WriteLine(response.Data.Name);
});

// abort the request on demand
asyncHandle.Abort();

About

Simple REST and HTTP API Client for .NET

restsharp.org

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

3 stars

Watchers

8 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.