コード例 #1
0
 /// <summary>
 /// Get video operation result.
 /// </summary>
 /// <param name="operation">The operation.</param>
 /// <returns>Operation status.</returns>
 public async Task<OperationResult> GetOperationResultAsync(Operation operation)
 {
     var response = await SendRequestAsync(HttpMethod.Get, operation.Url, null);
     var responseContent = await response.Content.ReadAsStringAsync();
     return JsonConvert.DeserializeObject<OperationResult>(responseContent as string, s_settings);
 }
コード例 #2
0
 /// <summary>
 /// Create video operation.
 /// </summary>
 /// <param name="videoUrl">Video url.</param>
 /// <param name="operationType">>Operation type.</param>
 /// <returns>Video operation created.</returns>
 public async Task<Operation> CreateOperationAsync(string videoUrl, OperationType operationType)
 {
     var url = string.Format("{0}/{1}", ServiceHost, operationType.ToString().ToLowerInvariant());
     var response = await SendRequestAsync(HttpMethod.Post, url, new VideoUrlRequest() { Url = videoUrl });
     Operation operation = new Operation(response.Headers.GetValues(OperationLocation).First());
     return operation;
 }