HL Interactive (HLi) Source Code Readme Copyright © HL Interactive 2015, Thomas Hagström, Horisontvägen 85, Stockholm, Sweden
HL Interactive (HLi) data operations project.
Typed HttpClient
and other portable .net client utilities.
HttpClient
with strongly typed request / response. It also parses HTTP errors and throws friendly Exceptions.
var client = new HliHttpClient("http://httpbin.org/", "ip");
var result = await client.GetDataAsTypeAsync<IpResponse>();
var client = new HliHttpClient("http://httpbin.org/", "post");
var result = await client.PostDataAsTypeAsync<HttpBinPost>();
Download the nuget package through Package Manager Console:
install-package HLI.Data
- Projects
- Packages
- HLI.Core
- Microsoft.Net.Http
- Newtonsoft.Json
The project HLI.Data is configured to automatically generate a *.nupkg upon build with dotnet cli
.
- HLI.Data - solution root folder
- HLI.Data (Portable) - main project. Depends on Microsoft.AspNet.WebApi.Client
- Clients - contain helper classes for constructing clients for web services HTTP, WCF etc.
- Extensions - data layer related extensions.
- HLI.Data.Tests.Integration - integration tests for this solution
- HLI.Data (Portable) - main project. Depends on Microsoft.AspNet.WebApi.Client
- Converted to netcore: multi-target netstandard 1.4 & PCL.
- Removed invalid
Microsoft.AspNet.WebApi.Client
reference (fixing Android errors). - Optimized Json Serialization / Deserialization
-
Newtonsoft.Json is now set to
Copy local = False
to prevent conflicts. Ensure the above package is installed and referenced in the platform project. -
Constructors for
HliHttpClient
are now completely revised to prevent ambigus constructor issues. Usage might need to be updated. -
Added support for different type request / response in
PostDataAsTypeAsync
Unit Tests as well as integration tests should be placed in solution root.