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