using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-using Newtonsoft.Json.Serialization;
using NLog;
using System;
using System.Collections.Generic;
-using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace GumartinM.JsonRPC4NET
{
+ /// <summary>
+ /// Json rpc http async client.
+ /// </summary>
public class JsonRpcHttpAsyncClient
{
/// <summary>
/// <returns>The async.</returns>
/// <param name="uri">URI.</param>
/// <param name="method">Method.</param>
+ /// <param name="jsonData">JsonData.</param>
/// <param name="cancellation">Cancellation.</param>
/// <typeparam name="TResult">The 1st type parameter.</typeparam>
async private Task<POSTResult<TResult>> PostAsync<TResult>(string uri, string method, string jsonData, CancellationToken cancellation)
}
}
+ /// <summary>
+ /// Reads the response async.
+ /// </summary>
+ /// <returns>The response async.</returns>
+ /// <param name="content">Content.</param>
+ /// <typeparam name="TResult">The 1st type parameter.</typeparam>
async private Task<POSTResult<TResult>> ReadResponseAsync<TResult>(HttpContent content)
{
- /**
- * Taken from HttpContent.cs ReadAsStringAsync() Mono implementation.
- */
+ // Taken from HttpContent.cs ReadAsStringAsync() Mono implementation.
Encoding encoding;
if (content.Headers != null && content.Headers.ContentType != null && content.Headers.ContentType.CharSet != null)
{
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>12.0.0</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0C624E8F-9C80-457F-A7D1-39FA29E23F79}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GumartinM.JsonRPC4NET</RootNamespace>
- <AssemblyName>jsonrpc4net</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Description>Dirty implementation of JSON RPC. Just trying to learn how
to use C#.</Description>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
+ <ReleaseVersion>1.0</ReleaseVersion>
+ <SynchReleaseVersion>false</SynchReleaseVersion>
+ <AssemblyName>jsonrpc4net</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
+ <DocumentationFile>bin\Release\jsonrpc4net.xml</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <WarningLevel>4</WarningLevel>
+ <DocumentationFile>bin\Debug\jsonrpc4net.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
- <Reference Include="System.Net.Http">
- <HintPath>..\..\..\..\..\..\..\usr\mymono\lib\mono\4.5\System.Net.Http.dll</HintPath>
- </Reference>
- <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=c7439020c8fedf87">
- <Package>monodevelop</Package>
- </Reference>
<Reference Include="NLog">
- <HintPath>..\..\ThirdParty\Libs\NLog\net45\NLog.dll</HintPath>
+ <HintPath>..\packages\NLog.3.1.0.0\lib\net45\NLog.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Net.Http" />
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.6.0.7\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="JsonRpcClientException.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Microsoft.Bcl" version="1.1.3" targetFramework="wp80" />
- <package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="wp80" />
- <package id="Microsoft.Net.Http" version="2.2.18" targetFramework="wp80" />
- <package id="Newtonsoft.Json" version="6.0.1" targetFramework="wp80" />
- <package id="NLog" version="2.1.0" targetFramework="wp80" />
+ <package id="Microsoft.Bcl" version="1.1.9" />
+ <package id="Microsoft.Bcl.Build" version="1.0.21" />
+ <package id="Microsoft.Net.Http" version="2.2.28" />
+ <package id="Newtonsoft.Json" version="6.0.7" />
+ <package id="NLog" version="3.1.0.0" />
</packages>
\ No newline at end of file