public async Task <FetchStreamResponse> FetchStreamAsync(FetchStreamRequest model) { try { string json = JsonConvert.SerializeObject(model); StringContent stringContent = new StringContent(json, Encoding.Default, "application/json"); var result = await client.PostAsync(API_VERSION + "/fetchStream", stringContent); if (result.StatusCode == HttpStatusCode.Unauthorized) { return(new FetchStreamResponse { 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 <FetchStreamResponse>(jsonResponse); return(response); } catch (Exception e) { var ex = new Image4ioException("There is an error while fetching an stream", e); throw ex; } }
public Task <FetchStreamResponse> FetchStreamAsync(FetchStreamRequest model) { throw new NotImplementedException(); }
public FetchStreamResponse FetchStream(FetchStreamRequest model) => FetchStreamAsync(model).ConfigureAwait(false).GetAwaiter().GetResult();
public FetchStreamResponse FetchStream(FetchStreamRequest model) { throw new NotImplementedException(); }