public async Task <FetchImageResponse> FetchImageAsync(FetchImageRequest model) { try { string json = JsonConvert.SerializeObject(model); StringContent stringContent = new StringContent(json, Encoding.Default, "application/json"); var result = await client.PostAsync(API_VERSION + "/fetchImage", stringContent); if (result.StatusCode == HttpStatusCode.Unauthorized) { return(new FetchImageResponse { Success = false, Errors = new List <string> { "Unauthorized. Please check your API Key and API Secret." } }); } var jsonResponse = await result.Content.ReadAsStringAsync(); var response = JsonConvert.DeserializeObject <FetchImageResponse>(jsonResponse); return(response); } catch (Exception e) { var ex = new Image4ioException("There is an error while deleting an image", e); throw ex; } }
public Task <IActionResult> FetchImage([FromBody] FetchImageRequest request) { throw new NotImplementedException(nameof(FetchImage)); }
public Task <FetchImageResponse> FetchImageAsync(FetchImageRequest model) { throw new NotImplementedException(); }
public FetchImageResponse FetchImage(FetchImageRequest model) => FetchImageAsync(model).ConfigureAwait(false).GetAwaiter().GetResult();
public FetchImageResponse FetchImage(FetchImageRequest model) { throw new NotImplementedException(); }