Skip to content
/ JsonHttp Public

A simple library to quickly turn JSON responses from API endpoints into useable classes.

License

Notifications You must be signed in to change notification settings

vixez/JsonHttp

Repository files navigation

JsonHttp

About

This is a simple library to quickly turn JSON responses from API endpoints into useable classes.

##NuGet

Install-Package JsonHttp 

NuGet page

##Compatibility This NuGet package is built for: .NET Framework 4.6+, Windows (Phone) 8, Windows (Phone) 8.1, Windows Phone 8.1 Silverlight, Windows 10

##Features

  • GET
  • POST
  • PUT
  • DELETE
  • Autoredirect
  • Headers
  • Set request as type of JSON

###Planned

  • Timeout + callback event
  • Use objects as HttpContent for POST/PUT

##Examples ###Getting quick results You only need to use one line of code to do a basic GET request

WordOfTheDay wotd = await JsonHttp.Get<WordOfTheDay>(new Uri("http://urban-word-of-the-day.herokuapp.com/today"));

###More advanced You can also add some extra options to the request

JsonHttp.Options options = new JsonHttp.Options()
{
    AllowAutoRedirect = true,
    DefaultRequestHeaders = new Dictionary<string, string>(),
    AddMediaTypeWithQualityHeadersJson = true,
    UseLocationHeaderForRedirects = true
};
WordOfTheDay wotd = await JsonHttp.Get<WordOfTheDay>(new Uri("http://urban-word-of-the-day.herokuapp.com/today"), options); 

##More info JsonHttp was made by Glenn Ruysschaert.

It makes use of the HttpClient libraries provided by Microsoft and JSON.Net by James Newton-King

Find more info and other projects, go to my site www.glennruysschaert.com

##License Read license

About

A simple library to quickly turn JSON responses from API endpoints into useable classes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages