JsonHCS.Net
1.4.0
Install-Package JsonHCS.Net -Version 1.4.0
dotnet add package JsonHCS.Net --version 1.4.0
<PackageReference Include="JsonHCS.Net" Version="1.4.0" />
paket add JsonHCS.Net --version 1.4.0
#r "nuget: JsonHCS.Net, 1.4.0"
// Install JsonHCS.Net as a Cake Addin
#addin nuget:?package=JsonHCS.Net&version=1.4.0
// Install JsonHCS.Net as a Cake Tool
#tool nuget:?package=JsonHCS.Net&version=1.4.0
JsonHCS.Net
JsonHCS (Json Http Client Simplified) for .Net is a HTTP Client wrapper with Json support. JSON parsing is done by the Newtonsoft.Json library.
JsonHCS.Proxies can interpret a class with requests and responses on the fly for even easier API management: For more info about Json.Net.Proxies visit this page.
Support
Supported platforms: .Net Standard 1.1+
Supported requests:
- GET
- POST
- PUT
- DELETE
- File Download + Upload
Usage
Include the package in NuGet: https://www.nuget.org/packages/JsonHCS.Net/
Add the right usings
using JsonHCSNet;
- Construct with your preferred options
var settings = new JsonHCS_Settings()
{
CookieSupport = true, //I want to support sessions and thus cookies
AddDefaultAcceptHeaders = true, //Adds default acceptance headers for json types
UserAgent = "MyAwesomeSampleAgent" //Because why not, this is usually ignored anyways
};
using (JsonHCS client = new JsonHCS(settings))
{
//use client
}
- Use it!
//Use POCO's for data:
Console.WriteLine("Get<ExpectedResponce> ToString:");
ExpectedResponce obj = await client.GetJsonAsync<ExpectedResponce>(Url); //Gets json from url and parses as the ExpectedResponce class
Console.WriteLine(obj);
///Use dynamic
dynamic obj = await client.GetJsonAsync(Url);
Console.WriteLine(obj.firstName);
//Use JObject
var JObj = await client.GetJObjectAsync(Url);
Console.WriteLine(JObj["firstName"]);
A more complete sample can be found in the source.
Issues
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard1.1 netstandard1.2 netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1 |
.NET Framework | net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen30 tizen40 tizen60 |
Universal Windows Platform | uap uap10.0 |
Windows Phone | wpa81 |
Windows Store | netcore netcore45 netcore451 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETStandard 1.1
- NETStandard.Library (>= 1.6.1)
- Newtonsoft.Json (>= 12.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on JsonHCS.Net:
Package | Downloads |
---|---|
JsonHCS.Net.Proxies
JsonHCS.Net.Proxies for .Net is a JsonHCS.Net based proxy generator for easy and fast (but powerful) api definitions |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.4.0 | 241 | 10/18/2021 |
1.3.0 | 520 | 11/10/2020 |
1.2.0 | 589 | 2/14/2020 |
1.1.2 | 634 | 11/16/2019 |
1.1.1 | 720 | 10/23/2019 |
1.1.0 | 740 | 7/9/2019 |
1.0.9 | 549 | 5/22/2019 |
1.0.8 | 435 | 5/15/2019 |
1.0.7 | 391 | 4/11/2019 |
1.0.6 | 901 | 12/6/2018 |
1.0.5 | 569 | 12/4/2018 |
1.0.4 | 590 | 10/12/2018 |
1.0.3 | 628 | 8/23/2018 |
1.0.2 | 704 | 5/23/2018 |
1.0.1 | 731 | 5/13/2018 |
1.0.0 | 657 | 2/13/2018 |
-Fixed GetStream Actually returning the original stream instead of a copy
-Added tests for the GetStream and GetMemoryStream methods
-Now cleanly disposing internally used responses