HttpCross is a simple and easy in use HTTP client for .NET solutions
- .NET Framework 4+
- Windows Store
- Windows Phone 8+
- Silverlight 5
- Xamarin IOS/Android
GET
var books = await Http.New
.WithHeader("x-auth-token", "YW55IGNhcm5hbCBwb")
.GetJson<List<Book>>("http://localhost:5055/api/books");
POST
await Http.New
.WithHeader("x-auth-token", "YW55IGNhcm5hbCBwb")
.WithJsonBody(new
{
name = "Domain-Driven Design: Tackling Complexity in the Heart of Software",
author = "Eric Evans",
publication_date = new DateTime(2003, 08, 01)
})
.Post("http://localhost:5055/api/books");
PUT
await Http.New
.WithHeader("x-auth-token", "YW55IGNhcm5hbCBwb")
.WithJsonBody(new
{
name = "Domain-Driven Design: Tackling Complexity in the Heart of Software",
author = "Eric Evans",
publication_date = new DateTime(2003, 08, 01),
number_of_pages = 320
})
.Put("http://localhost:5055/api/books/7439");
DELETE
await Http.New
.WithHeader("x-auth-token", "YW55IGNhcm5hbCBwb")
.Delete("http://localhost:5055/api/books/7439");