Using HttpContent.ReadAsAsync<T> to parse responses with one object or an array Using HttpContent.ReadAsAsync<T> to parse responses with one object or an array json json

Using HttpContent.ReadAsAsync<T> to parse responses with one object or an array


Create your ResponseObj as a generic class.

public class ResponseObj<T> {  public MetaObj Meta {get;set;}  public T Data {get;set;}}

You can deserialize json using HttpContent.ReadAsAsync<ResponseObj<DataObj>> or HttpContent.ReadAsAsync<ResponseObj<DataObj[]>>