20 lines
483 B
C#
20 lines
483 B
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net.Http;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Knoks.Core.Exchanges
|
|
{
|
|
public static class HttpExtensions
|
|
{
|
|
public static async Task<T> ReadAsJsonAsync<T>(this HttpContent content)
|
|
{
|
|
string json = await content.ReadAsStringAsync();
|
|
T value = JsonConvert.DeserializeObject<T>(json);
|
|
return value;
|
|
}
|
|
}
|
|
}
|