Skip to content
jonnii edited this page Apr 17, 2012 · 1 revision

Here's a simple example of how to use SpeakEasy.

// create an http client... 
var client = HttpClient.Create("http://api.myapp.com");

// execute a GET request on the url "products/5", on a 200 response deserialize the body as a Product
var product = client.Get("products/:id", new { id = 5 }).OnOk().As<Product>();

// update the product
product.Name = "Styx's Greatest Hits";

// save the product
client.Patch(product, "products").IsOk();

Done!

Clone this wiki locally