You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
using Newtonsoft.Json; |
|
|
|
namespace MatrixDotNetLib |
|
{ |
|
public class MatrixImageInfo : MatrixImageThumbInfo |
|
{ |
|
[JsonProperty("thumbnail_info")] |
|
public MatrixImageThumbInfo ThumbnailInfo { get; set; } |
|
|
|
public string ThumbnailUrl { 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<MatrixError>(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<MatrixLoginResponse>(responseString); |
|
|
|
// return response; |
|
//} |