/// <summary> /// Creates content for a request to TranscribeCall. /// </summary> /// <param name="callSid">The callSid to set in the content.</param> /// <param name="recordingUrl">The recordingUrl to set in the content.</param> /// <returns>The content.</returns> private static HttpContent CreateHttpPostContent(string callSid, string recordingUrl) { TranscribeCallRequest requestObj = new TranscribeCallRequest() { CallSid = callSid, RecordingUri = recordingUrl, }; return(new StringContent( JsonConvert.SerializeObject(requestObj))); }
private static HttpRequest CreateHttpPostRequest(string callSid, string recordingUrl) { HttpContext httpContext = new DefaultHttpContext(); HttpRequest request = new DefaultHttpRequest(httpContext); TranscribeCallRequest requestObj = new TranscribeCallRequest() { CallSid = callSid, RecordingUri = recordingUrl, }; Stream contentBytes = new MemoryStream( Encoding.UTF8.GetBytes( JsonConvert.SerializeObject(requestObj))); request.Body = contentBytes; return(request); }