Put, Post, Patch

Put, Post and Patch perform a HTTP action on a resource, they take an optional object as a parameter (can be a anonymous type or a static object type) representing the data you want to submit.

Example usage:

dynamic client = new RestClient("https://jsonplaceholder.typicode.com");

var user = new {  name="foo", email="foo@bar.com", userId=10 }; 

//POST { "name":"foo", "email":"foo@bar.com", "userId":10 } https://jsonplaceholder.typicode.com/users
var result = await client.Users.Post(user);
dynamic client = new RestClient("https://jsonplaceholder.typicode.com");

var user = new User new { name="foo", email="foo@bar.com" };

//PUT { "name":"foo", "email":"foo@bar.com" }  https://jsonplaceholder.typicode.com/users/1
var result = await client.User(1).Put(user);
dynamic client = new RestClient("https://jsonplaceholder.typicode.com");

var user = new User new { name="foo", email="foo@bar.com" };

//PATCH{ "name":"foo", "email":"foo@bar.com" }  https://jsonplaceholder.typicode.com/users/1
var result = await client.User(1).Patch(user);

You can find more usage examples in the DalSoft.RestClient.Test.Unit and DalSoft.RestClient.Test.Integration projects.