using Newtonsoft.Json; namespace MatrixDotNetLib { public class MatrixImageThumbInfo : MatrixFileInfo { [JsonProperty("w")] public int Width { get; set; } [JsonProperty("h")] public int Height { get; set; } } } //// simplest implementation //// might not work for UWP //// sauce: https://stackoverflow.com/questions/5527316/how-to-set-the-content-of-an-httpwebrequest-in-c //HttpContent requestContent = new StringContent(requestJson, Encoding.UTF8, "application/json"); //HttpClient client = new HttpClient(); //client.BaseAddress = new Uri(loginUrl); //client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); //HttpResponseMessage responseMessage = client.PostAsync(loginUrl, requestContent).Result; //string responseString = responseMessage.Content.ReadAsStringAsync().Result; //if(responseString.Contains("errcode")) //{ // // deserialize into error object // MatrixError error = JsonConvert.DeserializeObject(responseString); // // convert error object to a string // string errMsg = error.ErrorCode + ": " + error.ErrorMessage; // // throw exception (can be caught and handled gracefully) // throw new Exception(errMsg); //} //else //{ // MatrixLoginResponse response = JsonConvert.DeserializeObject(responseString); // return response; //}