blob: 155836fbacebdbc0958a5f99947dbe00db96ab8e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
namespace Timeline.Tests.Helpers
{
public static class ResponseExtensions
{
public static async Task<T> ReadBodyAsJson<T>(this HttpResponseMessage response)
{
return JsonConvert.DeserializeObject<T>(await response.Content.ReadAsStringAsync());
}
}
}
|