private static async Task<HttpContent> ToStreamContent(ObjectContent content)
        {
            Stream stream = await content.ReadAsStreamAsync();
            StreamContent streamContent = new StreamContent(stream);
            foreach (var header in content.Headers)
            {
                streamContent.Headers.TryAddWithoutValidation(header.Key, header.Value);
            }

            return streamContent;
        }