상속: HttpContent
예제 #1
5
        public Stream Upload(string url, string filename, Stream fileStream)
        {
            HttpContent stringContent = new StringContent(filename);
            HttpContent fileStreamContent = new StreamContent(fileStream);

            using (var handler = new ProgressMessageHandler())
            using (var client = HttpClientFactory.Create(handler))
            using (var formData = new MultipartFormDataContent())
            {
                client.Timeout = new TimeSpan(1, 0, 0); // 1 hour should be enough probably

                formData.Add(fileStreamContent, "file", filename);

                handler.HttpSendProgress += (s, e) =>
                {
                    float prog = (float)e.BytesTransferred / (float)fileStream.Length;
                    prog = prog > 1 ? 1 : prog;

                    if (FileProgress != null)
                        FileProgress(filename, prog);
                };

                var response_raw = client.PostAsync(url, formData);

                var response = response_raw.Result;

                if (!response.IsSuccessStatusCode)
                {
                    return null;
                }
                return response.Content.ReadAsStreamAsync().Result;
            }
        }
예제 #2
3
        public async Task<Models.Media> File(Stream fileStream, string name = "", string description = "", string projectId = null)
        {
            using (var formData = new MultipartFormDataContent())
            {
                AddStringContent(formData, _client.Authentication.FieldName, _client.Authentication.Value);
                AddStringContent(formData, "project_id", projectId);
                AddStringContent(formData, "name", name);
                AddStringContent(formData, "description", description);

                // Add the file stream
                var fileContent = new StreamContent(fileStream);
                fileContent.Headers.Add("Content-Type", "application/octet-stream");
                fileContent.Headers.Add("Content-Disposition", "form-data; name=\"file\"; filename=\"" + name + "\"");
                formData.Add(fileContent, "file", name);

                // HttpClient problem workaround
                var boundaryValue = formData.Headers.ContentType.Parameters.FirstOrDefault(p => p.Name == "boundary");
                if (boundaryValue != null)
                {
                    boundaryValue.Value = boundaryValue.Value.Replace("\"", string.Empty);
                }

                // Upload the file
                var response = await _client.Post(Client.UploadUrl, formData);

                return _client.Hydrate<Models.Media>(response);
            }
        }
예제 #3
2
        /// <summary>
        ///   Add a <see cref="Stream"/> to interplanetary file system.
        /// </summary>
        /// <param name="stream"></param>
        public async Task<MerkleNode> AddAsync(Stream stream)
        {
            var content = new MultipartFormDataContent();
            var streamContent = new StreamContent(stream);
            streamContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
            content.Add(streamContent, "file");

            try
            {
                var url = BuildCommand("add");
                if (log.IsDebugEnabled)
                    log.Debug("POST " + url.ToString());
                using (var response = await Api().PostAsync(url, content))
                {
                    await ThrowOnError(response);
                    var json = await response.Content.ReadAsStringAsync();
                    if (log.IsDebugEnabled)
                        log.Debug("RSP " + json);
                    var r = JObject.Parse(json);

                    return new MerkleNode((string)r["Hash"]);
                }
            }
            catch (IpfsException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new IpfsException(e);
            }
        }
 /// <summary>Creates a GZip content based on the given content.</summary>
 /// <param name="content">Content to GZip.</param>
 /// <returns>GZiped HTTP content.</returns>
 internal static HttpContent CreateZipContent(string content)
 {
     var stream = CreateGZipStream(content);
     var sc = new StreamContent(stream);
     sc.Headers.ContentEncoding.Add("gzip");
     return sc;
 }
 public static async Task<ImgurEntity> UploadImgur(IRandomAccessStream fileStream)
 {
     try
     {
         var imageData = new byte[fileStream.Size];
         for (int i = 0; i < imageData.Length; i++)
         {
             imageData[i] = (byte)fileStream.AsStreamForRead().ReadByte();
         }
         var theAuthClient = new HttpClient();
         var request = new HttpRequestMessage(HttpMethod.Post, "https://api.imgur.com/3/image");
         request.Headers.Authorization = new AuthenticationHeaderValue("Client-ID", "e5c018ac1f4c157");
         var form = new MultipartFormDataContent();
         var t = new StreamContent(fileStream.AsStream());
         // TODO: See if this is the correct way to use imgur's v3 api. I can't see why we would still need to convert images to base64.
         string base64Img = Convert.ToBase64String(imageData);
         t.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
         form.Add(new StringContent(base64Img), @"image");
         form.Add(new StringContent("file"), "type");
         request.Content = form;
         HttpResponseMessage response = await theAuthClient.SendAsync(request);
         string responseString = await response.Content.ReadAsStringAsync();
         if (responseString == null) return null;
         var imgurEntity = JsonConvert.DeserializeObject<ImgurEntity>(responseString);
         return imgurEntity;
     }
     catch (WebException)
     {
     }
     catch (IOException)
     {
         return null;
     }
     return null;
 }
        protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)
        {
            receivedRequest = new HttpRequestMessage {Method = request.Method, RequestUri = request.RequestUri, Version = request.Version};
            foreach (var h in request.Headers)
            {
                receivedRequest.Headers.Add(h.Key, h.Value);
            }

            if (request.Content != null)
            {
                var stream = new MemoryStream();
                request.Content.CopyTo(stream);
                stream.Seek(0, SeekOrigin.Begin);

                var content = new StreamContent(stream);
                foreach (var h in request.Content.Headers)
                {
                    content.Headers.Add(h.Key, h.Value);
                }

                receivedRequest.Content = content;
            }

            return response;
        }
예제 #7
0
        /// <summary>
        /// Генерация заголовков
        /// </summary>
        /// <param name="request"></param>
        /// <param name="uri"></param>
        /// <returns></returns>
        private static HttpRequestMessage CreateProxyHttpRequest(Microsoft.AspNetCore.Http.HttpRequest request, Uri uri)
        {
            var requestMessage = new HttpRequestMessage();
            var requestMethod  = request.Method;

            if (!HttpMethods.IsGet(requestMethod) &&
                !HttpMethods.IsHead(requestMethod) &&
                !HttpMethods.IsDelete(requestMethod) &&
                !HttpMethods.IsTrace(requestMethod))
            {
                var streamContent = new StreamContent(request.Body);
                requestMessage.Content = streamContent;
            }

            // Copy the request headers
            foreach (var header in request.Headers)
            {
                if (string.Compare(header.Key, "port", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    continue;
                }
                if (!requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()) && requestMessage.Content != null)
                {
                    requestMessage.Content?.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
                }
            }

            requestMessage.Headers.Host = uri.Authority;
            requestMessage.RequestUri   = uri;
            requestMessage.Method       = new HttpMethod(request.Method);

            return(requestMessage);
        }
예제 #8
0
        public async Task <string> UploadFirmware(string fileName, Stream binFile)
        {
            CameraInfo.UpdatingFirmware = true;
            try
            {
                string requestStr = String.Format("http://{0}/upgrade_firmware.cgi", CameraInfo.IpAddress);

                var fileContents = new System.Net.Http.StreamContent(binFile);
                fileContents.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");

                var content = new System.Net.Http.MultipartFormDataContent("---------------------------7deef381d07b6");
                content.Add(fileContents, "file", fileName);

                // override the content disposition
                var contentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("form-data");
                contentDisposition.Name                 = "file";
                contentDisposition.FileName             = fileName;
                fileContents.Headers.ContentDisposition = contentDisposition;

                return(await PostFormRequest(requestStr, content));
            }
            finally
            {
                // actually, let's wait for next ping to succeed which means the reboot is finished.
                // CameraInfo.UpdatingFirmware = false;
            }
        }
        private StreamContent ConvertToStreamContent(HttpContent originalContent)
        {
            if (originalContent == null)
            {
                return null;
            }

            StreamContent streamContent = originalContent as StreamContent;

            if (streamContent != null)
            {
                return streamContent;
            }

            MemoryStream ms = new MemoryStream();
            originalContent.CopyToAsync(ms).Wait();

              ms.Position = 0;

            streamContent = new StreamContent(ms);

             foreach (KeyValuePair<string, IEnumerable<string>> header in originalContent.Headers)
            {
                streamContent.Headers.TryAddWithoutValidation(header.Key, header.Value);
            }

            return streamContent;
        }
예제 #10
0
        protected override Task<HttpResponseMessage> SendAsync(
            HttpRequestMessage request,
            CancellationToken cancellationToken)
        {
            OwinRequest owinRequest = OwinRequest.Create();
            owinRequest.Scheme = request.RequestUri.Scheme;
            owinRequest.Method = request.Method.ToString();
            owinRequest.Path = request.RequestUri.AbsolutePath;
            owinRequest.QueryString = request.RequestUri.Query.TrimStart('?');
            owinRequest.CallCancelled = cancellationToken;
            foreach (var header in request.Headers)
            {
                owinRequest.AddHeaderUnmodified(header.Key, header.Value);
            }
            HttpContent requestContent = request.Content;
            if (requestContent != null)
            {
                foreach (var header in request.Content.Headers)
                {
                    owinRequest.AddHeaderUnmodified(header.Key, header.Value);
                }
            }
            else
            {
                requestContent = new StreamContent(Stream.Null);
            }

            return requestContent.ReadAsStreamAsync()
                .Then(requestBody =>
                {
                    owinRequest.Body = requestBody;
                    var responseMemoryStream = new MemoryStream();

                    var owinResponse = new OwinResponse(owinRequest)
                    {
                        Body = responseMemoryStream
                    };

                    return _invoke.Invoke(owinRequest.Dictionary)
                        .Then(() =>
                        {
                            var response = new HttpResponseMessage();
                            response.StatusCode = (HttpStatusCode)owinResponse.StatusCode;
                            response.ReasonPhrase = owinResponse.ReasonPhrase;
                            response.RequestMessage = request;
                            // response.Version = owinResponse.Protocol;

                            responseMemoryStream.Seek(0, SeekOrigin.Begin);
                            response.Content = new StreamContent(responseMemoryStream);
                            foreach (var header in owinResponse.Headers)
                            {
                                if (!response.Headers.TryAddWithoutValidation(header.Key, header.Value))
                                {
                                    response.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
                                }
                            }
                            return response;
                        });
                });
        }
 public static void AddContent(this MultipartContent multipart, string name, Guid content)
 {
     var streamContent = new StreamContent(new MemoryStream(Encoding.UTF8.GetBytes(content.ToString())));
     streamContent.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("string");
     streamContent.Headers.ContentDisposition.Name = String.Format("\"{0}\"", name);
     multipart.Add(streamContent);
 }
예제 #12
0
        public void PutBlob(string containerName, string key, Stream stream, Dictionary<string, string> metadata)
        {
            var url = GetUrl(containerName) + "/" + key;

            var now = SystemTime.UtcNow;
            var content = new StreamContent(stream)
                          {
                              Headers =
                              {
                                  { "x-ms-date", now.ToString("R") }, 
                                  { "x-ms-version", "2011-08-18" },
                                  { "x-ms-blob-type", "BlockBlob" },
                                  { "Content-Length", stream.Length.ToString(CultureInfo.InvariantCulture) }
                              }
                          };

            foreach (var metadataKey in metadata.Keys)
                content.Headers.Add("x-ms-meta-" + metadataKey.ToLower(), metadata[metadataKey]);

            var client = GetClient(TimeSpan.FromHours(1));
            client.DefaultRequestHeaders.Authorization = CalculateAuthorizationHeaderValue("PUT", url, content.Headers);

            var response = AsyncHelpers.RunSync(() => client.PutAsync(url, content));

            if (response.IsSuccessStatusCode)
                return;

            throw ErrorResponseException.FromResponseMessage(response);
        }
        HttpContent IHttpContentEncryptor.Decrypt(HttpContent encryptedContent)
        {
            if (encryptedContent == null)
            {
                throw new ArgumentNullException("encryptedContent");
            }

            var encodedString = encryptedContent.ReadAsStringAsync().Result;

            using (var encryptedData = new MemoryStream(Convert.FromBase64String(encodedString)))
            {
                if (encryptedData.Length == 0)
                {
                    return encryptedContent;
                }

                this.algorithm.Key = this.keyProvider.Key;
                this.algorithm.IV = this.keyProvider.IV;

                using (var decryptor = algorithm.CreateDecryptor())
                {
                    var cryptoStream = new CryptoStream(encryptedData, decryptor, CryptoStreamMode.Read);
                    var originData = new MemoryStream((int)encryptedData.Length);
                    cryptoStream.CopyTo(originData);
                    originData.Flush();
                    originData.Position = 0;

                    var originContent = new StreamContent(originData);
                    originContent.Headers.ContentType = encryptedContent.Headers.ContentType;

                    return originContent;
                }
            }
        }
        public async Task<HttpResponseMessage> UploadFileAsync(string path, CancellationToken token, IProgress<double> progress)
        {
            int bufferSize = ResolveBufferSize(path);

            using (var client = new HttpClient())
            using (var content = new MultipartFormDataContent())
            using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize, FileOptions.Asynchronous))
            using (var stream = progress == null ? new ReportableStream(fileStream) : new ReportableStream(fileStream, progress))
            using (var streamContent = new StreamContent(stream, bufferSize))
            {
                content.Add(streamContent);

                var mediaType = IOUtil.GetMimeType(path);
                streamContent.Headers.ContentType = new MediaTypeHeaderValue(mediaType);
                var disposition = CreateContentDispositionHeader(path);

                streamContent.Headers.ContentDisposition = disposition;

                client.DefaultRequestHeaders.UserAgent.ParseAdd(Settings.UserAgent);
                string uriString = string.Format(QueryString, Settings.Host, Settings.SessionId);

                var uri = new Uri(uriString);

                return await client.PostAsync(uri, content, token).ConfigureAwait(false);
            }
        }
        /// <summary>
        /// Post request
        /// </summary>
        /// <param name="uri">Enqueue endpoint URI</param>
        /// <param name="authenticationHeader">Authentication header</param>
        /// <param name="bodyStream">Body stream</param>        
        /// <param name="message">ActivityMessage context</param>
        /// <returns></returns>
        public async Task<HttpResponseMessage> SendPostRequestAsync(Uri uri, Stream bodyStream, string externalCorrelationHeaderValue = null)
        {
            using (HttpClientHandler handler = new HttpClientHandler() { UseCookies = false })
            {
                using (HttpClient httpClient = new HttpClient(handler))
                {
                    httpClient.DefaultRequestHeaders.Authorization = AuthenticationHelper.GetValidAuthenticationHeader();

                    // Add external correlation id header id specified and valid
                    if (!string.IsNullOrEmpty(externalCorrelationHeaderValue))
                    {
                        httpClient.DefaultRequestHeaders.Add(Program.ExternalCorrelationHeader, externalCorrelationHeaderValue);
                    }

                    if (bodyStream != null)
                    {
                        using (StreamContent content = new StreamContent(bodyStream))
                        {
                            return await httpClient.PostAsync(uri, content);
                        }
                    }
                }
            }

            return new HttpResponseMessage()
            {
                Content = new StringContent("Request failed at client.", Encoding.ASCII),
                StatusCode = System.Net.HttpStatusCode.PreconditionFailed
            };
        }
예제 #16
0
        /// <summary>
        /// Uploads a file to the specified endpoint
        /// </summary>
        /// <param name="token">The authentication token</param>
        /// <param name="path">The endpoint to invoke</param>
        /// <param name="filename">The local file system path to the file</param>
        /// <param name="contentType">The mime-type</param>
        /// <returns>The result of the operation</returns>
        internal async Task<string> UploadFile(AuthToken token, string path, string filename, string contentType)
        {
            using (HttpClient client = new HttpClient())
            {
                HttpRequestMessage message = new HttpRequestMessage();
                message.Method = HttpMethod.Post;
                message.RequestUri = new Uri($"{_baseAddress}/{path}");
                message.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token.Token);
                

                var content =
                    new MultipartFormDataContent("Upload----" + DateTime.Now.ToString(CultureInfo.InvariantCulture));
          

                var streamContent = new StreamContent(File.OpenRead(filename));
                streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType);
                content.Add(streamContent, Path.GetFileName(filename), Path.GetFileName(filename));
                message.Content = content;

                var response =
                    await client.SendAsync(message);

                if (response.IsSuccessStatusCode)
                {
                    return await response.Content.ReadAsStringAsync();

                }
                else
                {
                    throw new ApplicationException($"{response.StatusCode} {response.ReasonPhrase}");
                }
            }

        }
예제 #17
0
 virtual protected async Task <Response> CreateRequest <Response>(
     string url,
     net.HttpMethod method,
     object input,
     string token)
 {
     return(await CreateRequestMessage(url, method, token, async (msg) =>
     {
         if (input is Stream stream)
         {
             using (var content = new net.StreamContent(stream))
             {
                 content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                 msg.Content = content;
                 return await GetResult <Response>(msg);
             }
         }
         else
         {
             using (var content = new net.StringContent(JObject.FromObject(input).ToString()))
             {
                 content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                 msg.Content = content;
                 return await GetResult <Response>(msg);
             }
         }
     }));
 }
 public static void AddContent(this MultipartContent multipart, string name, Stream content)
 {
     var streamContent = new StreamContent(content);
     streamContent.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("file");
     streamContent.Headers.ContentDisposition.Name = String.Format("\"{0}\"", name);
     multipart.Add(streamContent);
 }
        public async Task ThumbnailContentRequest_PutAsync()
        {
            using (var requestStream = new MemoryStream())
            using (var httpResponseMessage = new HttpResponseMessage())
            using (var responseStream = new MemoryStream())
            using (var streamContent = new StreamContent(responseStream))
            {
                httpResponseMessage.Content = streamContent;

                var requestUrl = "https://api.onedrive.com/v1.0/drive/items/id/thumbnails/0/id/content";
                this.httpProvider.Setup(
                    provider => provider.SendAsync(
                        It.Is<HttpRequestMessage>(
                            request => request.RequestUri.ToString().StartsWith(requestUrl)),
                        HttpCompletionOption.ResponseContentRead,
                        CancellationToken.None))
                    .Returns(Task.FromResult(httpResponseMessage));

                var expectedThumbnail = new Thumbnail { Url = "https://localhost" };

                this.serializer.Setup(
                    serializer => serializer.DeserializeObject<Thumbnail>(It.IsAny<string>()))
                    .Returns(expectedThumbnail);

                var responseThumbnail = await this.oneDriveClient.Drive.Items["id"].Thumbnails["0"]["id"].Content.Request().PutAsync<Thumbnail>(requestStream);

                Assert.IsNotNull(responseThumbnail, "Thumbnail not returned.");
                Assert.AreEqual(expectedThumbnail, responseThumbnail, "Unexpected thumbnail returned.");
            }
        }
        public async Task ItemCreateLinkRequest_PostAsync()
        {
            using (var httpResponseMessage = new HttpResponseMessage())
            using (var responseStream = new MemoryStream())
            using (var streamContent = new StreamContent(responseStream))
            {
                httpResponseMessage.Content = streamContent;

                var requestUrl = Constants.Authentication.OneDriveConsumerBaseUrl + "/drive/items/id/action.createLink";
                this.httpProvider.Setup(
                    provider => provider.SendAsync(
                        It.Is<HttpRequestMessage>(
                            request => request.RequestUri.ToString().StartsWith(requestUrl))))
                    .Returns(Task.FromResult(httpResponseMessage));

                var expectedPermission = new Permission { Id = "id", Link = new SharingLink { Type = "edit" } };

                this.serializer.Setup(
                    serializer => serializer.SerializeObject(It.IsAny<ItemCreateLinkRequestBody>()))
                    .Returns("request body value");

                this.serializer.Setup(
                    serializer => serializer.DeserializeObject<Permission>(It.IsAny<string>()))
                    .Returns(expectedPermission);

                var permission = await this.oneDriveClient.Drive.Items["id"].CreateLink("edit").Request().PostAsync();

                Assert.IsNotNull(permission, "Permission not returned.");
                Assert.AreEqual(expectedPermission, permission, "Unexpected permission returned.");
            }
        }
예제 #21
0
        public void PutObject(string bucketName, string key, Stream stream, Dictionary<string, string> metadata, int timeoutInSeconds)
        {
            var url = GetUrl(bucketName) + "/" + key;

            var now = SystemTime.UtcNow;

            var payloadHash = RavenAwsHelper.CalculatePayloadHash(stream);

            var content = new StreamContent(stream)
                          {
                              Headers =
                              {
                                  { "x-amz-date", RavenAwsHelper.ConvertToString(now) },
                                  { "x-amz-content-sha256", payloadHash }
                              }
                          };

            foreach (var metadataKey in metadata.Keys)
                content.Headers.Add("x-amz-meta-" + metadataKey.ToLower(), metadata[metadataKey]);

            var headers = ConvertToHeaders(bucketName, content.Headers);

            var client = GetClient(TimeSpan.FromSeconds(timeoutInSeconds));
            var authorizationHeaderValue = CalculateAuthorizationHeaderValue("PUT", url, now, headers);
            client.DefaultRequestHeaders.Authorization = authorizationHeaderValue;

            var response = AsyncHelpers.RunSync(() => client.PutAsync(url, content));
            if (response.IsSuccessStatusCode)
                return;

            throw ErrorResponseException.FromResponseMessage(response);
        }
        public void ReadFromStreamAsyncShouldReturnUploadImageDataTest()
        {
            ImageMultipartMediaFormatter target = new ImageMultipartMediaFormatter();
            Type type = typeof(UploadImageData);
            Stream readStream = null;
            MultipartContent content = new MultipartContent("form-data");
            byte[] content_bytes=new byte[] { 10, 11, 12 };
            StreamContent content_part = new StreamContent(new MemoryStream(content_bytes));
            content_part.Headers.Add("Content-Disposition", @"form-data; name=fieldName; filename=image.jpg");
            content_part.Headers.Add("Content-Type", "image/jpeg");
            content.Add(content_part);
            IFormatterLogger formatterLogger = null;

            var actual = target.ReadFromStreamAsync(type, readStream, content, formatterLogger);
            var actualResult = actual.Result;

            Assert.IsInstanceOfType(actualResult,typeof(UploadImageData));
            Assert.AreEqual(3, (actualResult as UploadImageData).ImageBuffer.Length);
            for (int ind = 0; ind < 3; ind++)
            {
                Assert.AreEqual(content_bytes[ind], (actualResult as UploadImageData).ImageBuffer[ind]);
            }
            Assert.AreEqual("image.jpg", (actualResult as UploadImageData).FileName);
            Assert.AreEqual("image/jpeg", (actualResult as UploadImageData).ImageType);
        }
예제 #23
0
        public async System.Threading.Tasks.Task AddEvent(string collection, JObject anEvent)
        {
            var content = anEvent.ToString();

            using (var client = new HttpClient())
            using (var contentStream = new StreamContent(new MemoryStream(Encoding.UTF8.GetBytes(content))))
            {
                contentStream.Headers.Add("content-type", "application/json");

                client.DefaultRequestHeaders.Add("Authorization", _prjSettings.WriteKey);
                var httpResponse = await client.PostAsync(_serverUrl + collection, contentStream)
                    .ConfigureAwait(continueOnCapturedContext: false);
                var responseString = await httpResponse.Content.ReadAsStringAsync()
                    .ConfigureAwait(continueOnCapturedContext: false);
                JObject jsonResponse = null;
                try
                {
                    // Normally the response content should be parsable JSON,
                    // but if the server returned a 404 error page or something
                    // like that, this will throw. 
                    jsonResponse = JObject.Parse(responseString);
                }
                catch (Exception) 
                { }

                // error checking, throw an exception with information from the 
                // json response if available, then check the HTTP response.
                KeenUtil.CheckApiErrorCode(jsonResponse);
                if (!httpResponse.IsSuccessStatusCode)
                    throw new KeenException("AddEvent failed with status: " + httpResponse);
            }
        }
        /// <inheritdoc/>
        public async Task<Uri> UploadMessageAsync(Stream content, DateTime expirationUtc, string contentType = null, string contentEncoding = null, IProgress<int> bytesCopiedProgress = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            Requires.NotNull(content, nameof(content));
            Verify.Operation(this.HttpClient != null, $"{nameof(this.HttpClient)} must be set first.");

            var httpContent = new StreamContent(content.ReadStreamWithProgress(bytesCopiedProgress));
            if (content.CanSeek)
            {
                httpContent.Headers.ContentLength = content.Length;
            }

            if (contentType != null)
            {
                httpContent.Headers.ContentType = new MediaTypeHeaderValue(contentType);
            }

            if (contentEncoding != null)
            {
                httpContent.Headers.ContentEncoding.Add(contentEncoding);
            }

            int lifetime = expirationUtc == DateTime.MaxValue ? int.MaxValue : (int)(expirationUtc - DateTime.UtcNow).TotalMinutes;
            var response = await this.HttpClient.PostAsync(this.BlobPostUrl.AbsoluteUri + "?lifetimeInMinutes=" + lifetime, httpContent).ConfigureAwait(false);
            response.EnsureSuccessStatusCode();

            var serializer = new DataContractJsonSerializer(typeof(string));
            var location = (string)serializer.ReadObject(await response.Content.ReadAsStreamAsync().ConfigureAwait(false));
            return new Uri(location, UriKind.Absolute);
        }
예제 #25
0
        private void AttachFiles(IMail message, MultipartFormDataContent content)
		{
			var files = FetchFileBodies(message);
            foreach (var file in files)
            {
                var ifile = file.Value;
                var fileContent = new StreamContent(ifile.OpenAsync(FileAccess.Read).Result);

                fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data")
                {
                    Name =  "files[" + ifile.Name + "]",
                    FileName = ifile.Name
                };

                fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("application/octet-stream");
                content.Add(fileContent); 
            }
           
            var streamingFiles = FetchStreamingFileBodies(message);
			foreach (KeyValuePair<string, MemoryStream> file in streamingFiles) {
				var name = file.Key;
				var stream = file.Value;
                var fileContent = new StreamContent(stream);
               
                fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data")
                {
                    Name = "files[" + name + "]",
                    FileName = name
                };

                fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("application/octet-stream");
                content.Add(fileContent); 
			}
        }
        public void ReadFromStreamAsync_Deserializes_Actions_Correctly()
        {
            // Arrange
            Car car = new Car();
            string inputString =
                "{\"class\":[],\"properties\":{\"numberOfWheels\":0},\"entities\":[],\"actions\":[{\"name\":\"Start\",\"class\":[\"StartAction\"],\"method\":\"POST\",\"href\":\"https://api.test.com/car/start\",\"title\":\"Start the car\",\"type\":\"application/json\",\"fields\":[]}]}";

            // Act
            using (MemoryStream stream = new MemoryStream(System.Text.Encoding.Default.GetBytes(inputString)))
            {
                var content = new StreamContent(stream);

                var task = formatter.ReadFromStreamAsync(typeof(Car), stream, content, null);
                car = task.Result as Car;
            }

            WebApiContrib.MediaType.Hypermedia.Action startTheCarAction = car.Actions[0];

            // Assert
            Assert.Equal("Start", startTheCarAction.Name);
            Assert.Equal("StartAction", startTheCarAction.Class[0]);
            Assert.Equal(HTTP_Method.POST, startTheCarAction.Method);
            Assert.Equal("https://api.test.com/car/start", startTheCarAction.Href.ToString());
            Assert.Equal("Start the car", startTheCarAction.Title);
            Assert.Equal("application/json", startTheCarAction.Type);
        }
예제 #27
0
        public Guid UpdloadFileForSharing(string filename,string apiKey, string projectName /*,string ownerEmail*/)
        {
            if (string.IsNullOrWhiteSpace(filename)) { throw new ArgumentNullException("filename"); }
            if (string.IsNullOrWhiteSpace(apiKey)) { throw new ArgumentNullException("apiKey"); }
            if (string.IsNullOrWhiteSpace(projectName)) { throw new ArgumentNullException("projectName"); }
            // if (string.IsNullOrWhiteSpace(ownerEmail)) { throw new ArgumentNullException("ownerEmail"); }
            if (!File.Exists(filename)) {
                throw new FileNotFoundException(filename);
            }

            string baseUrl = Settings.Default.LocanServiceBaseUrl;

            string urlForSharing = string.Format(
                "{0}/{1}",
                baseUrl,
                Consts.UrlAddPhrasesForTranslation);

            Guid userId = this.GetUserIdForApiKey(apiKey);
            LocanWebFile webFile = this.GetTranslationFile(apiKey, filename, userId, projectName);
            JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
            byte[]bytes = Encoding.UTF8.GetBytes(jsonSerializer.Serialize(webFile));

            using (HttpClient client = new HttpClient())
            using(MemoryStream stream = new MemoryStream(bytes)){
                StreamContent streamContent = new StreamContent(stream);
                HttpResponseMessage response = client.Post(urlForSharing, streamContent);
                response.EnsureSuccessStatusCode();
                string guidString = response.Content.ReadAsString();
                // Result looks like: <?xml version="1.0" encoding="utf-8"?><guid>2158e8e5-ae6c-4b9a-a7ab-3169fff9750d</guid>
                XDocument doc = XDocument.Parse(guidString);
                return new Guid(doc.Root.Value);
            }
        }
예제 #28
0
        private async Task<HttpResponseMessage> EditUserCommit(int id, dynamic targetObject)
        {
            try
            {
                var person = (ProjectMemberContrainModel)targetObject;

                using (var ms = new MemoryStream())
                {
                    var djs = new DataContractJsonSerializer(typeof(ProjectMemberContrainModel));
                    djs.WriteObject(ms, person);
                    ms.Position = 0;
                    var sc = new StreamContent(ms);
                    sc.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");

                    var resp = id == -1
                                   ? await HttpClient.PostAsync(new Uri(ApiRoot), sc)
                                   : await HttpClient.PutAsync(new Uri(ApiRoot + @"/" + id), sc);

                    resp.EnsureSuccessStatusCode();
                    return resp;
                }

            }
            catch (Exception ex)
            {
                LogManager.Instance.LogException(ex.ToString());
                return new HttpResponseMessage(HttpStatusCode.NotModified);
            }
        }
		public async Task<HttpResponseMessage> Post()
		{
			var content = new StreamContent(Request.Body);
			content.Headers.ContentType = MediaTypeHeaderValue.Parse(Request.Headers["Content-Type"]);
			var response = await _httpClient.PostAsync(_apiUrl, content);
			return response;
		}
예제 #30
0
		public string UploadArchive(string glacierVaultName, Stream stream, string archiveDescription, int timeoutInSeconds)
		{
			var url = string.Format("{0}/-/vaults/{1}/archives", GetUrl(null), glacierVaultName);

			var now = SystemTime.UtcNow;

			var payloadHash = RavenAwsHelper.CalculatePayloadHash(stream);
			var payloadTreeHash = RavenAwsHelper.CalculatePayloadTreeHash(stream);

			var content = new StreamContent(stream)
			              {
				              Headers =
				              {
								  { "x-amz-glacier-version", "2012-06-01"},
								  { "x-amz-date", RavenAwsHelper.ConvertToString(now) },
								  { "x-amz-content-sha256", payloadHash },
								  { "x-amz-sha256-tree-hash", payloadTreeHash },
								  { "x-amz-archive-description", archiveDescription }
				              }
			              };

			var headers = ConvertToHeaders(glacierVaultName, content.Headers);

			var client = GetClient(TimeSpan.FromSeconds(timeoutInSeconds));
			var authorizationHeaderValue = CalculateAuthorizationHeaderValue("POST", url, now, headers);
			client.DefaultRequestHeaders.Authorization = authorizationHeaderValue;

			var response = client.PostAsync(url, content).ResultUnwrap();
			if (response.IsSuccessStatusCode)
				return ReadArchiveId(response);

			throw ErrorResponseException.FromResponseMessage(response);
		}
        private async Task<StreamContent> ConvertToStreamContentAsync(HttpContent originalContent)
        {
            if (originalContent == null)
            {
                return null;
            }

            StreamContent streamContent = originalContent as StreamContent;

            if (streamContent != null)
            {
                return streamContent;
            }

            MemoryStream ms = new MemoryStream();
            await originalContent.CopyToAsync(ms);

            // Reset the stream position back to 0 as in the previous CopyToAsync() call,
            // a formatter for example, could have made the position to be at the end
            ms.Position = 0;

            streamContent = new StreamContent(ms);

            // copy headers from the original content
            foreach (KeyValuePair<string, IEnumerable<string>> header in originalContent.Headers)
            {
                streamContent.Headers.TryAddWithoutValidation(header.Key, header.Value);
            }

            return streamContent;
        }
예제 #32
0
        public async Task<HttpResponseMessage> Get(string key)
        {
            var cachedItem = MemoryCache.Default.Get(key) as byte[];

            if(cachedItem == null)
            {
                return new HttpResponseMessage(HttpStatusCode.NoContent);
            }


            Stream stream = null;

            if (cachedItem != null)
            {
                stream = new MemoryStream();
                await stream.WriteAsync(cachedItem, 0, cachedItem.Length);
                stream.Position = 0;
            }

            //var content = new PushStreamContent(async (stream, httpContent, transportContext) =>
            //{
            //    await stream.WriteAsync(cachedItem, 0, cachedItem.Length);
            //    stream.Close();
            //});

            var content = new StreamContent(stream);
            return new HttpResponseMessage() { Content = content };
        }
예제 #33
0
        public static byte[] PostMultipartFormDataBodyReturnBytes(string url, IDictionary <string, object> values, IList <string> fileNames, Encoding encoding = null, IDictionary <string, string> headers = null, string referrer = null, string accept = null)
        {
            var content = new System.Net.Http.MultipartFormDataContent();

            if (encoding == null)
            {
                encoding = Encoding.UTF8;
            }
            int i = 0;

            foreach (var item in values)
            {
                if (item.Value == null)
                {
                    content.Add(new System.Net.Http.StringContent(""), item.Key);
                }
                else if (item.Value.GetType() == typeof(byte[]))
                {
                    var cc = new System.Net.Http.StreamContent(new MemoryStream((byte[])item.Value));
                    cc.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("image/jpeg");
                    content.Add(cc, item.Key, fileNames[i]);
                    i++;
                }
                else if (item.Value.GetType() == typeof(DateTime))
                {
                    content.Add(new System.Net.Http.StringContent(((DateTime)item.Value).ToString("yyyy-MM-dd HH:mm:ss")), item.Key);
                }
                else if (item.Value is Enum)
                {
                    content.Add(new System.Net.Http.StringContent(((int)item.Value).ToString()), item.Key);
                }
                else if (item.Value is double)
                {
                    content.Add(new System.Net.Http.StringContent(((double)item.Value).ToString("F2")), item.Key);
                }
                else if (item.Value is float)
                {
                    content.Add(new System.Net.Http.StringContent(((float)item.Value).ToString("F2")), item.Key);
                }
                else
                {
                    content.Add(new System.Net.Http.StringContent(item.Value.ToString()), item.Key);
                }
            }
            var client = SetupClient(headers, referrer, accept);
            var ret    = client.PostAsync(url, content).Result;

            if (ret.IsSuccessStatusCode == false)
            {
                throw new Exception("HTTP请求错误:" + ret.StatusCode);
            }
            var data = ret.Content.ReadAsByteArrayAsync().Result;

            return(data);
        }
예제 #34
0
            /// <summary>
            /// 添付ファイルを追加
            /// </summary>
            /// <param name="path"></param>
            /// <returns></returns>
            public async Task <bool> UploadFile(int id, string path)
            {
                var filename = System.IO.Path.GetFileName(path);
                var url      = $"{_baseurl}uploads.json?filename={filename}";
                var contnet  = new System.Net.Http.StreamContent(System.IO.File.OpenRead(path));

                contnet.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
                var res = await _cl.PostAsync(url, contnet);

                var json = await res.Content.ReadAsStringAsync();

                JObject o = JsonConvert.DeserializeObject(json) as JObject;
                // トークンを取得
                string token = o.Value <JObject>("upload").Value <string>("token");

                string contentType = "text/plain";

                switch (System.IO.Path.GetExtension(path).ToLower())
                {
                case ".txt": contentType = "text/plain"; break;

                case ".bmp": contentType = "image/bmp"; break;

                case ".jpg": contentType = "image/jpeg"; break;

                case ".png": contentType = "image/png"; break;

                case ".pdf": contentType = "application/pdf"; break;

                case ".doc": contentType = "application/word"; break;

                case ".docx": contentType = "application/word"; break;

                case ".xls": contentType = "application/excel"; break;

                case ".xlsx": contentType = "application/excel"; break;

                case ".zip": contentType = "application/zip"; break;

                default: contentType = "text/plain"; break;
                }
                url  = $"{_baseurl}{_tablename}/{id}.json";
                json = new IssueUpload(token, filename, contentType).ToJson();
                var contnet2 = new StringContent(json, Encoding.UTF8, "application/json");

                res = await _cl.PutAsync(url, contnet2);

                System.Diagnostics.Debug.WriteLine(json);
                return(true);
            }
예제 #35
0
    static void Main(string[] args)
    {
        Task.Run(async() =>
        {
            string base64img = "iVBORw0KGgoAAAANSUhEUgAAAscAAAF2CAYAAACCiDVjAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAHPaSURBVHhe7b13uC1Fmbf9/feFN80bxhnDzOgMoqIoopgdlYzgoAIiOecMBw45S84555xzVFDJSZIkBSQYECQIKOOo09+5e/ezT+3a1atTda/us391Xfd1zl5dXfV0dXXXvXpVd/9f//d/+XoihBBCCCGE+HoiORZCCCGEECJDciyEEEIIIUSG5FgIIYQQQogMybEQQgghhBAZkmMhhBBCCCEyJMdCCCGEEEJkSI6FEEIIIYTIkBwLI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EEIIITIkx0IIIYQQQmRIjoUQQgghhMiQHAshhBBCCJEhORZCCCGEECJDciyEEEIIIUSG5FgIIYQQQogMybEQQgghhBAZkmMhhBBCCCEyJMdCCCGEEEJkSI6FEEIIIYTIkBwLIYQQQgiRITkWQgghhBAiQ3IshBBCCCFEhuRYCCGEEEKIDMmxEEIIIYQQGZJjIYQQQgghMiTHQgghhBBCZEiOhRBCCCGEyJAcCyGEEEIIkSE5FkIIIYQQIkNyLIQQQgghRIbkWAghhBBCiAzJsRBCCCGEEBmSYyGEEEIIIVK+nvz/hJ+9GPj4350AAAAASUVORK5CYII=";
            string urlpost   = "https://dev.oscato.com/vicaj3j";

            var bytes    = Convert.FromBase64String(base64img);
            var contents = new  System.Net.Http.StreamContent(new MemoryStream(bytes));


            var client   = new HttpClient();
            var response = await client.PostAsync(urlpost, contents);
            Console.WriteLine(response);
        }).GetAwaiter().GetResult();
    }
예제 #36
0
        public static byte[] PostMultipartFormDataBodyReturnBytes(string url, IDictionary <string, object> values, Encoding encoding = null, IDictionary <string, string> headers = null, string referrer = null, string accept = null)
        {
            var content = new System.Net.Http.MultipartFormDataContent();

            encoding = encoding ?? Encoding.UTF8;
            foreach (var item in values)
            {
                if (item.Value == null)
                {
                    throw new Exception("参数的值为NULL");
                }
                else if (item.Value is byte)
                {
                    var cc = new System.Net.Http.StreamContent(new MemoryStream((byte[])item.Value));
                    cc.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("image/jpeg");
                    content.Add(cc, item.Key, item.Key);
                }
                else if (item.Value is string)
                {
                    content.Add(new System.Net.Http.StringContent(item.Value as string, encoding ?? Encoding.UTF8, "application/x-www-form-urlencoded"), item.Key);
                }
                else
                {
                    throw new Exception("不支持的类型:" + item.Value.GetType().FullName);
                }
            }
            var client = SetupClient(headers, referrer, accept);
            HttpResponseMessage ret = null;

            try
            {
                ret = client.PostAsync(url, content).Result;
            }
            catch (Exception ex)
            {
                throw GetOrignalException(ex);
            }
            if (ret.IsSuccessStatusCode == false)
            {
                throw new Exception("HTTP请求错误:" + ret.StatusCode);
            }
            var data = ret.Content.ReadAsByteArrayAsync().Result;

            return(data);
        }
예제 #37
0
        /// <summary>
        /// Upload from stream
        /// </summary>
        /// <returns>StatusResult: statusCode= Http response statuscode, status=Http response reasonphrase</returns>
        /// <param name="url">formatted URL (contains query parameters)</param>
        /// <param name="stream">Stream to upload from</param>
        public async Task <StatusResult> SaveBinaryAsync(string url, Stream stream)
        {
            StatusResult result = new StatusResult();

            try {
                HttpContent content = new System.Net.Http.StreamContent(stream);                 //StringContent (postData, System.Text.Encoding.UTF8, "application/json");
                //content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/image");
                HttpResponseMessage response = await client.PostAsync(new Uri(url), content);

                if (!response.IsSuccessStatusCode)
                {
                    result.statusCode = ((int)response.StatusCode);
                    result.status     = response.ReasonPhrase;
                }
            } catch (Exception ex) {
                result.statusCode = 1;
                result.status     = ex.Message;
            }
            return(result);
        }
예제 #38
0
        /* Responsible for creating a request of the specified type. Used
         * only during POST and PUT since it requires a payload to be provided.
         */
        async Task <Response <TOut> > CreateContentRequest <TOut>(
            string url,
            net.HttpMethod method,
            object input,
            Dictionary <string, string> headers)
        {
            using (var msg = CreateRequestMessage(method, url, headers))
            {
                if (input is Stream stream)
                {
                    using (var content = new net.StreamContent(stream))
                    {
                        AddContentHeaders(content, headers);
                        msg.Content = content;
                        return(await GetResult <TOut>(msg));
                    }
                }
                else if (input is byte[] bytes)
                {
                    using (var content = new net.ByteArrayContent(bytes))
                    {
                        AddContentHeaders(content, headers);
                        msg.Content = content;
                        return(await GetResult <TOut>(msg));
                    }
                }

                var stringContent = input is string strInput ?
                                    strInput :
                                    JObject.FromObject(input).ToString();

                using (var content = new net.StringContent(stringContent))
                {
                    AddContentHeaders(content, headers);
                    msg.Content = content;
                    return(await GetResult <TOut>(msg));
                }
            }
        }
예제 #39
0
        private HttpContent UnpackContent(object outContent)
        {
            if (outContent == null)
            {
                return(null);
            }
            var httpCont = outContent as HttpContent;

            if (httpCont != null)
            {
                return(httpCont);
            }
            var text = outContent as string;

            if (text != null)
            {
                var cont = new System.Net.Http.StreamContent(new System.IO.MemoryStream(Encoding.UTF8.GetBytes(text)));
                cont.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/html");
                return(cont);
            }
            Util.Throw("Invalid OutgoingResponseContent value type: {0}. Must be string or HttpContent.", outContent.GetType());
            return(null);
        }
예제 #40
0
        private System.Net.Http.StreamContent GetRequestContent <T>(T request, SignedRequestWriter writer) where T : class
        {
            System.IO.Stream?stream = null;
            try
            {
                stream = MemoryStreamFactory.CreateStream();
                writer.WriteRequest(request, stream);
                stream.Seek(0, System.IO.SeekOrigin.Begin);

                var retVal = new System.Net.Http.StreamContent(stream);
                retVal.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json")
                {
                    CharSet = System.Text.UTF8Encoding.UTF8.HeaderName
                };

                return(retVal);
            }
            catch
            {
                stream?.Dispose();

                throw;
            }
        }
예제 #41
0
        public static HttpResponseMessage CreateResponseMessage(
            WinHttpRequestState state,
            bool doManualDecompressionCheck)
        {
            HttpRequestMessage request         = state.RequestMessage;
            SafeWinHttpHandle  requestHandle   = state.RequestHandle;
            CookieUsePolicy    cookieUsePolicy = state.Handler.CookieUsePolicy;
            CookieContainer    cookieContainer = state.Handler.CookieContainer;
            var  response             = new HttpResponseMessage();
            bool stripEncodingHeaders = false;

            // Get HTTP version, status code, reason phrase from the response headers.
            string version = GetResponseHeaderStringInfo(requestHandle, Interop.WinHttp.WINHTTP_QUERY_VERSION);

            if (string.Compare("HTTP/1.1", version, StringComparison.OrdinalIgnoreCase) == 0)
            {
                response.Version = HttpVersion.Version11;
            }
            else if (string.Compare("HTTP/1.0", version, StringComparison.OrdinalIgnoreCase) == 0)
            {
                response.Version = HttpVersion.Version10;
            }
            else
            {
                response.Version = HttpVersion.Unknown;
            }

            response.StatusCode = (HttpStatusCode)GetResponseHeaderNumberInfo(
                requestHandle,
                Interop.WinHttp.WINHTTP_QUERY_STATUS_CODE);
            response.ReasonPhrase = GetResponseHeaderStringInfo(
                requestHandle,
                Interop.WinHttp.WINHTTP_QUERY_STATUS_TEXT);

            // Create response stream and wrap it in a StreamContent object.
            var    responseStream     = new WinHttpResponseStream(state);
            Stream decompressedStream = responseStream;

            if (doManualDecompressionCheck)
            {
                string contentEncoding = GetResponseHeaderStringInfo(
                    requestHandle,
                    Interop.WinHttp.WINHTTP_QUERY_CONTENT_ENCODING);
                if (!string.IsNullOrEmpty(contentEncoding))
                {
                    if (contentEncoding.IndexOf(EncodingNameDeflate, StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        decompressedStream   = new DeflateStream(responseStream, CompressionMode.Decompress);
                        stripEncodingHeaders = true;
                    }
                    else if (contentEncoding.IndexOf(EncodingNameGzip, StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        decompressedStream   = new GZipStream(responseStream, CompressionMode.Decompress);
                        stripEncodingHeaders = true;
                    }
                }
            }

            var content = new StreamContent(decompressedStream);

            response.Content        = content;
            response.RequestMessage = request;

            // Parse raw response headers and place them into response message.
            ParseResponseHeaders(requestHandle, response, stripEncodingHeaders);

            // Store response header cookies into custom CookieContainer.
            if (cookieUsePolicy == CookieUsePolicy.UseSpecifiedCookieContainer)
            {
                Debug.Assert(cookieContainer != null);

                if (response.Headers.Contains(HeaderNameSetCookie))
                {
                    IEnumerable <string> cookieHeaders = response.Headers.GetValues(HeaderNameSetCookie);
                    foreach (var cookieHeader in cookieHeaders)
                    {
                        try
                        {
                            cookieContainer.SetCookies(request.RequestUri, cookieHeader);
                        }
                        catch (CookieException)
                        {
                            // We ignore malformed cookies in the response.
                        }
                    }
                }
            }

            return(response);
        }
예제 #42
0
        /// <summary>
        /// <see cref="HttpContent"/> implementation which provides a byte range view over a stream used to generate HTTP
        /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend
        /// of the selected resource represented by the <paramref name="content"/> parameter then an
        /// <see cref="InvalidByteRangeException"/> is thrown indicating the valid Content-Range of the content.
        /// </summary>
        /// <param name="content">The stream over which to generate a byte range view.</param>
        /// <param name="range">The range or ranges, typically obtained from the Range HTTP request header field.</param>
        /// <param name="mediaType">The media type of the content stream.</param>
        /// <param name="bufferSize">The buffer size used when copying the content stream.</param>
        public ByteRangeStreamContent(
            Stream content,
            RangeHeaderValue range,
            MediaTypeHeaderValue mediaType,
            int bufferSize
            )
        {
            if (content == null)
            {
                throw Error.ArgumentNull("content");
            }
            if (!content.CanSeek)
            {
                throw Error.Argument(
                          "content",
                          Properties.Resources.ByteRangeStreamNotSeekable,
                          typeof(ByteRangeStreamContent).Name
                          );
            }
            if (range == null)
            {
                throw Error.ArgumentNull("range");
            }
            if (mediaType == null)
            {
                throw Error.ArgumentNull("mediaType");
            }
            if (bufferSize < MinBufferSize)
            {
                throw Error.ArgumentMustBeGreaterThanOrEqualTo(
                          "bufferSize",
                          bufferSize,
                          MinBufferSize
                          );
            }
            if (!range.Unit.Equals(SupportedRangeUnit, StringComparison.OrdinalIgnoreCase))
            {
                throw Error.Argument(
                          "range",
                          Properties.Resources.ByteRangeStreamContentNotBytesRange,
                          range.Unit,
                          SupportedRangeUnit
                          );
            }

            try
            {
                // If we have more than one range then we use a multipart/byteranges content type as wrapper.
                // Otherwise we use a non-multipart response.
                if (range.Ranges.Count > 1)
                {
                    // Create Multipart content and copy headers to this content
                    MultipartContent rangeContent = new MultipartContent(ByteRangesContentSubtype);
                    _byteRangeContent = rangeContent;

                    foreach (RangeItemHeaderValue rangeValue in range.Ranges)
                    {
                        try
                        {
                            ByteRangeStream rangeStream   = new ByteRangeStream(content, rangeValue);
                            HttpContent     rangeBodyPart = new StreamContent(rangeStream, bufferSize);
                            rangeBodyPart.Headers.ContentType  = mediaType;
                            rangeBodyPart.Headers.ContentRange = rangeStream.ContentRange;
                            rangeContent.Add(rangeBodyPart);
                        }
                        catch (ArgumentOutOfRangeException)
                        {
                            // We ignore range errors until we check that we have at least one valid range
                        }
                    }

                    // If no overlapping ranges were found then stop
                    if (!rangeContent.Any())
                    {
                        ContentRangeHeaderValue actualContentRange = new ContentRangeHeaderValue(
                            content.Length
                            );
                        string msg = Error.Format(
                            Properties.Resources.ByteRangeStreamNoneOverlap,
                            range.ToString()
                            );
                        throw new InvalidByteRangeException(actualContentRange, msg);
                    }
                }
                else if (range.Ranges.Count == 1)
                {
                    try
                    {
                        ByteRangeStream rangeStream = new ByteRangeStream(
                            content,
                            range.Ranges.First()
                            );
                        _byteRangeContent = new StreamContent(rangeStream, bufferSize);
                        _byteRangeContent.Headers.ContentType  = mediaType;
                        _byteRangeContent.Headers.ContentRange = rangeStream.ContentRange;
                    }
                    catch (ArgumentOutOfRangeException)
                    {
                        ContentRangeHeaderValue actualContentRange = new ContentRangeHeaderValue(
                            content.Length
                            );
                        string msg = Error.Format(
                            Properties.Resources.ByteRangeStreamNoOverlap,
                            range.ToString()
                            );
                        throw new InvalidByteRangeException(actualContentRange, msg);
                    }
                }
                else
                {
                    throw Error.Argument(
                              "range",
                              Properties.Resources.ByteRangeStreamContentNoRanges
                              );
                }

                // Copy headers from byte range content so that we get the right content type etc.
                _byteRangeContent.Headers.CopyTo(Headers);

                _content = content;
                _start   = content.Position;
            }
            catch
            {
                if (_byteRangeContent != null)
                {
                    _byteRangeContent.Dispose();
                }
                throw;
            }
        }
예제 #43
0
        public static HttpResponseMessage CreateResponseMessage(
            WinHttpRequestState state,
            bool doManualDecompressionCheck)
        {
            HttpRequestMessage request         = state.RequestMessage;
            SafeWinHttpHandle  requestHandle   = state.RequestHandle;
            CookieUsePolicy    cookieUsePolicy = state.Handler.CookieUsePolicy;
            CookieContainer    cookieContainer = state.Handler.CookieContainer;
            var  response             = new HttpResponseMessage();
            bool stripEncodingHeaders = false;

            // Create a single buffer to use for all subsequent WinHttpQueryHeaders string interop calls.
            // This buffer is the length needed for WINHTTP_QUERY_RAW_HEADERS_CRLF, which includes the status line
            // and all headers separated by CRLF, so it should be large enough for any individual status line or header queries.
            int bufferLength = GetResponseHeaderCharBufferLength(requestHandle, Interop.WinHttp.WINHTTP_QUERY_RAW_HEADERS_CRLF);

            char[] buffer = new char[bufferLength];

            // Get HTTP version, status code, reason phrase from the response headers.

            if (IsResponseHttp2(requestHandle))
            {
                response.Version = WinHttpHandler.HttpVersion20;
            }
            else
            {
                int versionLength = GetResponseHeader(requestHandle, Interop.WinHttp.WINHTTP_QUERY_VERSION, buffer);
                response.Version =
                    CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase("HTTP/1.1", buffer, 0, versionLength) ? HttpVersion.Version11 :
                    CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase("HTTP/1.0", buffer, 0, versionLength) ? HttpVersion.Version10 :
                    WinHttpHandler.HttpVersionUnknown;
            }

            response.StatusCode = (HttpStatusCode)GetResponseHeaderNumberInfo(
                requestHandle,
                Interop.WinHttp.WINHTTP_QUERY_STATUS_CODE);

            int reasonPhraseLength = GetResponseHeader(requestHandle, Interop.WinHttp.WINHTTP_QUERY_STATUS_TEXT, buffer);

            response.ReasonPhrase = reasonPhraseLength > 0 ?
                                    GetReasonPhrase(response.StatusCode, buffer, reasonPhraseLength) :
                                    string.Empty;

            // Create response stream and wrap it in a StreamContent object.
            var responseStream = new WinHttpResponseStream(requestHandle, state);

            state.RequestHandle = null; // ownership successfully transfered to WinHttpResponseStram.
            Stream decompressedStream = responseStream;

            if (doManualDecompressionCheck)
            {
                int contentEncodingStartIndex = 0;
                int contentEncodingLength     = GetResponseHeader(
                    requestHandle,
                    Interop.WinHttp.WINHTTP_QUERY_CONTENT_ENCODING,
                    buffer);

                CharArrayHelpers.Trim(buffer, ref contentEncodingStartIndex, ref contentEncodingLength);

                if (contentEncodingLength > 0)
                {
                    if (CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase(
                            EncodingNameGzip, buffer, contentEncodingStartIndex, contentEncodingLength))
                    {
                        decompressedStream   = new GZipStream(responseStream, CompressionMode.Decompress);
                        stripEncodingHeaders = true;
                    }
                    else if (CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase(
                                 EncodingNameDeflate, buffer, contentEncodingStartIndex, contentEncodingLength))
                    {
                        decompressedStream   = new DeflateStream(responseStream, CompressionMode.Decompress);
                        stripEncodingHeaders = true;
                    }
                }
            }

#if HTTP_DLL
            var content = new StreamContent(decompressedStream, state.CancellationToken);
#else
            // TODO: Issue https://github.com/dotnet/corefx/issues/9071
            // We'd like to be able to pass state.CancellationToken into the StreamContent so that its
            // SerializeToStreamAsync method can use it, but that ctor isn't public, nor is there a
            // SerializeToStreamAsync override that takes a CancellationToken.
            var content = new StreamContent(decompressedStream);
#endif

            response.Content        = content;
            response.RequestMessage = request;

            // Parse raw response headers and place them into response message.
            ParseResponseHeaders(requestHandle, response, buffer, stripEncodingHeaders);

            if (response.RequestMessage.Method != HttpMethod.Head)
            {
                state.ExpectedBytesToRead = response.Content.Headers.ContentLength;
            }

            return(response);
        }
예제 #44
0
 public StreamContent(Http.StreamContent content)
     : base(content)
 {
 }
예제 #45
0
 internal CurlResponseMessage(HttpRequestMessage request)
 {
     RequestMessage = request;
     Content        = new StreamContent(_responseStream);
 }
예제 #46
0
        public static HttpResponseMessage CreateResponseMessage(
            WinHttpRequestState state,
            bool doManualDecompressionCheck)
        {
            HttpRequestMessage request         = state.RequestMessage;
            SafeWinHttpHandle  requestHandle   = state.RequestHandle;
            CookieUsePolicy    cookieUsePolicy = state.Handler.CookieUsePolicy;
            CookieContainer    cookieContainer = state.Handler.CookieContainer;
            var  response             = new HttpResponseMessage();
            bool stripEncodingHeaders = false;

            // Create a single buffer to use for all subsequent WinHttpQueryHeaders string interop calls.
            // This buffer is the length needed for WINHTTP_QUERY_RAW_HEADERS_CRLF, which includes the status line
            // and all headers separated by CRLF, so it should be large enough for any individual status line or header queries.
            int bufferLength = GetResponseHeaderCharBufferLength(requestHandle, Interop.WinHttp.WINHTTP_QUERY_RAW_HEADERS_CRLF);

            char[] buffer = new char[bufferLength];

            // Get HTTP version, status code, reason phrase from the response headers.

            int versionLength = GetResponseHeader(requestHandle, Interop.WinHttp.WINHTTP_QUERY_VERSION, buffer);

            response.Version =
                CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase("HTTP/1.1", buffer, 0, versionLength) ? HttpVersion.Version11 :
                CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase("HTTP/1.0", buffer, 0, versionLength) ? HttpVersion.Version10 :
                HttpVersion.Unknown;

            response.StatusCode = (HttpStatusCode)GetResponseHeaderNumberInfo(
                requestHandle,
                Interop.WinHttp.WINHTTP_QUERY_STATUS_CODE);

            int reasonPhraseLength = GetResponseHeader(requestHandle, Interop.WinHttp.WINHTTP_QUERY_STATUS_TEXT, buffer);

            response.ReasonPhrase = reasonPhraseLength > 0 ?
                                    GetReasonPhrase(response.StatusCode, buffer, reasonPhraseLength) :
                                    string.Empty;

            // Create response stream and wrap it in a StreamContent object.
            var    responseStream     = new WinHttpResponseStream(requestHandle, state);
            Stream decompressedStream = responseStream;

            if (doManualDecompressionCheck)
            {
                int contentEncodingStartIndex = 0;
                int contentEncodingLength     = GetResponseHeader(
                    requestHandle,
                    Interop.WinHttp.WINHTTP_QUERY_CONTENT_ENCODING,
                    buffer);

                CharArrayHelpers.Trim(buffer, ref contentEncodingStartIndex, ref contentEncodingLength);

                if (contentEncodingLength > 0)
                {
                    if (CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase(
                            EncodingNameGzip, buffer, contentEncodingStartIndex, contentEncodingLength))
                    {
                        decompressedStream   = new GZipStream(responseStream, CompressionMode.Decompress);
                        stripEncodingHeaders = true;
                    }
                    else if (CharArrayHelpers.EqualsOrdinalAsciiIgnoreCase(
                                 EncodingNameDeflate, buffer, contentEncodingStartIndex, contentEncodingLength))
                    {
                        decompressedStream   = new DeflateStream(responseStream, CompressionMode.Decompress);
                        stripEncodingHeaders = true;
                    }
                }
            }

            var content = new StreamContent(decompressedStream);

            response.Content        = content;
            response.RequestMessage = request;

            // Parse raw response headers and place them into response message.
            ParseResponseHeaders(requestHandle, response, buffer, stripEncodingHeaders);

            if (response.RequestMessage.Method != HttpMethod.Head)
            {
                state.ExpectedBytesToRead = response.Content.Headers.ContentLength;
            }

            return(response);
        }
예제 #47
0
    /// <summary>Upload a new Job</summary>
    /// <param name="file">Input File</param>
    /// <param name="fScriptParams">Parameters for the script</param>
    /// <param name="scriptFilename">Script to use</param>
    /// <param name="outputFileFormat">format of the file output</param>
    /// <returns>Success</returns>
    /// <exception cref="SwaggerException">A server side error occurred.</exception>
    /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
    public async System.Threading.Tasks.Task <JobResult> UploadJobAsync(FileParameter file, string fScriptParams, string scriptFilename, string outputFileFormat, System.Threading.CancellationToken cancellationToken)
    {
        var urlBuilder_ = new System.Text.StringBuilder();

        urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/UploadJob");

        var client_ = _httpClient;

        try
        {
            using (var request_ = new System.Net.Http.HttpRequestMessage())
            {
                var boundary_ = System.Guid.NewGuid().ToString();
                var content_  = new System.Net.Http.MultipartFormDataContent(boundary_);
                content_.Headers.Remove("Content-Type");
                content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_);
                if (file != null)
                {
                    var content_file_ = new System.Net.Http.StreamContent(file.Data);
                    if (!string.IsNullOrEmpty(file.ContentType))
                    {
                        content_file_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(file.ContentType);
                    }
                    content_.Add(content_file_, "file", file.FileName ?? "file");
                }
                if (fScriptParams != null)
                {
                    content_.Add(new System.Net.Http.StringContent(ConvertToString(fScriptParams, System.Globalization.CultureInfo.InvariantCulture)), "fScriptParams");
                }
                if (scriptFilename != null)
                {
                    content_.Add(new System.Net.Http.StringContent(ConvertToString(scriptFilename, System.Globalization.CultureInfo.InvariantCulture)), "scriptFilename");
                }
                if (outputFileFormat != null)
                {
                    content_.Add(new System.Net.Http.StringContent(ConvertToString(outputFileFormat, System.Globalization.CultureInfo.InvariantCulture)), "outputFileFormat");
                }
                request_.Content = content_;
                request_.Method  = new System.Net.Http.HttpMethod("POST");
                request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

                PrepareRequest(client_, request_, urlBuilder_);
                var url_ = urlBuilder_.ToString();
                request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                PrepareRequest(client_, request_, url_);

                var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

                try
                {
                    var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                    if (response_.Content != null && response_.Content.Headers != null)
                    {
                        foreach (var item_ in response_.Content.Headers)
                        {
                            headers_[item_.Key] = item_.Value;
                        }
                    }

                    ProcessResponse(client_, response_);

                    var status_ = ((int)response_.StatusCode).ToString();
                    if (status_ == "200")
                    {
                        var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                        var result_ = default(JobResult);
                        try
                        {
                            result_ = Newtonsoft.Json.JsonConvert.DeserializeObject <JobResult>(responseData_, _settings.Value);
                            return(result_);
                        }
                        catch (System.Exception exception_)
                        {
                            throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
                        }
                    }
                    else
                    if (status_ != "200" && status_ != "204")
                    {
                        var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                        throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
                    }

                    return(default(JobResult));
                }
                finally
                {
                    if (response_ != null)
                    {
                        response_.Dispose();
                    }
                }
            }
        }
        finally
        {
        }
    }
예제 #48
0
        // Process request and craft response.
        public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback callback)
        {
            if (request.Method == "OPTIONS")
            {
                // This is the CORS request, and that's good
                base.StatusCode = 200;
                // base.Headers.Add("Access-Control-Allow-Origin", "*");
                base.Headers.Add("Access-Control-Allow-Methods", "GET,POST,PUT,OPTIONS");
                base.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Accept, authorization");
                callback.Continue();
                return(CefReturnValue.Continue);
            }
            var uri = new Uri(request.Url);

            Console.WriteLine($"-----------------\r\n{request.Url}");
            try
            {
                // This is a regular request
                Hl7.Fhir.Rest.FhirClient server = new Hl7.Fhir.Rest.FhirClient(_externalFhirServerBaseUrl);
                server.OnAfterResponse += (sender, args) =>
                {
                    base.Charset = args.RawResponse.CharacterSet;
                    foreach (string header in args.RawResponse.Headers.AllKeys)
                    {
                        if (!header.StartsWith("Access-Control"))
                        {
                            base.Headers.Add(header, args.RawResponse.Headers[header]);
                        }
                    }
                };
                server.PreferredFormat = Hl7.Fhir.Rest.ResourceFormat.Json;
                string redirectedUrl = server.Endpoint.OriginalString.TrimEnd('/') + uri.PathAndQuery;
                System.Diagnostics.Trace.WriteLine($"{redirectedUrl}");
                if (request.Method == "GET")
                {
                    System.Threading.Tasks.Task <Hl7.Fhir.Model.Resource> t = server.GetAsync(redirectedUrl).ContinueWith <Hl7.Fhir.Model.Resource>(r =>
                    {
                        if (r.Exception != null)
                        {
                            System.Diagnostics.Trace.WriteLine($"Error: {r.Exception.Message}");
                            if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                            {
                                base.StatusCode = (int)fe.Status;
                                if (fe.Outcome != null)
                                {
                                    base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                                    {
                                        Pretty = true
                                    }).SerializeToBytes(fe.Outcome));
                                    base.MimeType = "application/fhir+json";
                                }
                                callback.Continue();
                                System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                                return(null);
                            }
                        }
                        base.StatusCode = 200;

                        if (r.Result is Hl7.Fhir.Model.CapabilityStatement cs)
                        {
                            // As per the documentation http://hl7.org/fhir/smart-app-launch/conformance/index.html

                            // Update the security node with our internal security node
                            if (cs.Rest[0].Security == null)
                            {
                                cs.Rest[0].Security = new Hl7.Fhir.Model.CapabilityStatement.SecurityComponent();
                            }
                            Hl7.Fhir.Model.CapabilityStatement.SecurityComponent security = cs.Rest[0].Security;
                            if (!security.Service.Any(cc => cc.Coding.Any(c => c.System == "http://hl7.org/fhir/restful-security-service" && c.Code == "SMART-on-FHIR")))
                            {
                                security.Service.Add(new Hl7.Fhir.Model.CodeableConcept("http://hl7.org/fhir/restful-security-service", "SMART-on-FHIR"));
                            }
                            var extension = security.GetExtension("http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris");
                            if (extension == null)
                            {
                                extension = new Extension()
                                {
                                    Url = "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris"
                                };
                                security.Extension.Add(extension);
                            }
                            // remove the existing authentications, and put in our own
                            extension.Extension.Clear();
                            extension.AddExtension("token", new FhirUri($"https://{AuthProtocolSchemeHandlerFactory.AuthAddress(_launchContext)}/token"));
                            extension.AddExtension("authorize", new FhirUri($"https://{AuthProtocolSchemeHandlerFactory.AuthAddress(_launchContext)}/authorize"));
                        }

                        base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                        {
                            Pretty = true
                        }).SerializeToBytes(r.Result));
                        Console.WriteLine($"Success: {base.Stream.Length}");
                        base.MimeType = "application/fhir+json";
                        callback.Continue();
                        return(r.Result);
                    });
                }
                if (request.Method == "POST")
                {
                    System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
                    client.DefaultRequestHeaders.Add("Accept", request.GetHeaderByName("Accept"));
                    // client.DefaultRequestHeaders.Add("Content-Type", request.GetHeaderByName("Content-Type"));
                    HttpContent content = null;
                    if (request.PostData != null)
                    {
                        var data = request.PostData.Elements.FirstOrDefault();
                        var body = data.GetBody();
                        content = new System.Net.Http.StringContent(body, System.Text.Encoding.UTF8, request.GetHeaderByName("Content-Type"));
                    }
                    else
                    {
                        content = new System.Net.Http.StreamContent(null);
                    }
                    client.PostAsync(redirectedUrl, content).ContinueWith((System.Threading.Tasks.Task <HttpResponseMessage> r) =>
                    {
                        if (r.Exception != null)
                        {
                            Console.WriteLine($"Error: {r.Exception.Message}");
                            //if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                            //{
                            //    base.StatusCode = (int)fe.Status;
                            //    if (fe.Outcome != null)
                            //        base.Stream = new MemoryStream(r.Result.Content.ReadAsStringAsync().GetAwaiter().GetResult());
                            //    callback.Continue();
                            //    System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                            //    return;
                            //}
                        }
                        base.StatusCode = (int)r.Result.StatusCode;

                        base.Stream = r.Result.Content.ReadAsStreamAsync().GetAwaiter().GetResult();
                        Console.WriteLine($"Success: {base.Stream.Length}");
                        base.MimeType = r.Result.Content.Headers.ContentType.MediaType;
                        callback.Continue();
                        return;
                    });
                }
                if (request.Method == "PUT")
                {
                    System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
                    client.DefaultRequestHeaders.Add("Accept", request.GetHeaderByName("Accept"));
                    // client.DefaultRequestHeaders.Add("Content-Type", request.GetHeaderByName("Content-Type"));
                    HttpContent content = null;
                    if (request.PostData != null)
                    {
                        var data = request.PostData.Elements.FirstOrDefault();
                        var body = data.GetBody();
                        content = new System.Net.Http.StringContent(body, System.Text.Encoding.UTF8, request.GetHeaderByName("Content-Type"));
                    }
                    else
                    {
                        content = new System.Net.Http.StreamContent(null);
                    }
                    client.PutAsync(redirectedUrl, content).ContinueWith((System.Threading.Tasks.Task <HttpResponseMessage> r) =>
                    {
                        if (r.Exception != null)
                        {
                            Console.WriteLine($"Error: {r.Exception.Message}");
                            //if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                            //{
                            //    base.StatusCode = (int)fe.Status;
                            //    if (fe.Outcome != null)
                            //        base.Stream = new MemoryStream(r.Result.Content.ReadAsStringAsync().GetAwaiter().GetResult());
                            //    callback.Continue();
                            //    System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                            //    return;
                            //}
                        }
                        base.StatusCode = (int)r.Result.StatusCode;

                        base.Stream = r.Result.Content.ReadAsStreamAsync().GetAwaiter().GetResult();
                        Console.WriteLine($"Success: {base.Stream.Length}");
                        base.MimeType = r.Result.Content.Headers.ContentType.MediaType;
                        callback.Continue();
                        return;
                    });
                }
                return(CefReturnValue.ContinueAsync);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"{ex.Message}");
                callback.Dispose();
                return(CefReturnValue.Cancel);
            }
        }
예제 #49
0
        /// <summary>
        /// Upload file
        /// </summary>
        /// <param name='fileContent'>
        /// File to upload.
        /// </param>
        /// <param name='fileName'>
        /// File name to upload. Name has to be spelled exactly as written here.
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async Task <HttpOperationResponse <Stream> > UploadFileWithHttpMessagesAsync(Stream fileContent, string fileName, Dictionary <string, List <string> > customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (fileContent == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "fileContent");
            }
            if (fileName == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "fileName");
            }
            // Tracing
            bool   _shouldTrace  = ServiceClientTracing.IsEnabled;
            string _invocationId = null;

            if (_shouldTrace)
            {
                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary <string, object> tracingParameters = new Dictionary <string, object>();
                tracingParameters.Add("fileContent", fileContent);
                tracingParameters.Add("fileName", fileName);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(_invocationId, this, "UploadFile", tracingParameters);
            }
            // Construct URL
            var _baseUrl = Client.BaseUri.AbsoluteUri;
            var _url     = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "formdata/stream/uploadfile").ToString();
            // Create HTTP transport objects
            var _httpRequest = new System.Net.Http.HttpRequestMessage();

            System.Net.Http.HttpResponseMessage _httpResponse = null;
            _httpRequest.Method     = new System.Net.Http.HttpMethod("POST");
            _httpRequest.RequestUri = new System.Uri(_url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach (var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Serialize Request
            string _requestContent = null;

            System.Net.Http.MultipartFormDataContent _multiPartContent = new System.Net.Http.MultipartFormDataContent();
            if (fileContent != null)
            {
                System.Net.Http.StreamContent _fileContent = new System.Net.Http.StreamContent(fileContent);
                _fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
                FileStream _fileContentAsFileStream = fileContent as FileStream;
                if (_fileContentAsFileStream != null)
                {
                    System.Net.Http.Headers.ContentDispositionHeaderValue _contentDispositionHeaderValue = new System.Net.Http.Headers.ContentDispositionHeaderValue("form-data");
                    _contentDispositionHeaderValue.Name     = "fileContent";
                    _contentDispositionHeaderValue.FileName = _fileContentAsFileStream.Name;
                    _fileContent.Headers.ContentDisposition = _contentDispositionHeaderValue;
                }
                _multiPartContent.Add(_fileContent, "fileContent");
            }
            if (fileName != null)
            {
                System.Net.Http.StringContent _fileName = new System.Net.Http.StringContent(fileName, System.Text.Encoding.UTF8);
                _multiPartContent.Add(_fileName, "fileName");
            }
            _httpRequest.Content = _multiPartContent;
            // Send Request
            if (_shouldTrace)
            {
                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

            if (_shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            HttpStatusCode _statusCode = _httpResponse.StatusCode;

            cancellationToken.ThrowIfCancellationRequested();
            string _responseContent = null;

            if ((int)_statusCode != 200)
            {
                var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);

                    Error _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject <Error>(_responseContent, Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex.Body = _errorBody;
                    }
                }
                catch (Newtonsoft.Json.JsonException)
                {
                    // Ignore the exception
                }
                ex.Request  = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
                if (_shouldTrace)
                {
                    ServiceClientTracing.Error(_invocationId, ex);
                }
                _httpRequest.Dispose();
                if (_httpResponse != null)
                {
                    _httpResponse.Dispose();
                }
                throw ex;
            }
            // Create Result
            var _result = new HttpOperationResponse <Stream>();

            _result.Request  = _httpRequest;
            _result.Response = _httpResponse;
            // Deserialize Response
            if ((int)_statusCode == 200)
            {
                _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
            }
            if (_shouldTrace)
            {
                ServiceClientTracing.Exit(_invocationId, _result);
            }
            return(_result);
        }
예제 #50
0
        // Process request and craft response.
        public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback callback)
        {
            if (request.Method == "OPTIONS")
            {
                // This is the CORS request, and that's good
                base.StatusCode = 200;
                // base.Headers.Add("Access-Control-Allow-Origin", "*");
                base.Headers.Add("Access-Control-Allow-Methods", "GET,POST,PUT,OPTIONS");
                base.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Accept, authorization");
                callback.Continue();
                return(CefReturnValue.Continue);
            }
            var uri = new Uri(request.Url);

            Console.WriteLine($"-----------------\r\n{request.Url}");

            // Check the bearer header
            if (!string.IsNullOrEmpty(_launchContext.Bearer))
            {
                string bearer = request.GetHeaderByName("authorization");
                if (bearer != "Bearer " + _launchContext.Bearer)
                {
                    base.StatusCode = (int)HttpStatusCode.Unauthorized;
                    callback.Continue();
                    return(CefReturnValue.Continue);
                }
            }

            try
            {
                // This is a regular request
                Hl7.Fhir.Rest.FhirClient server = new Hl7.Fhir.Rest.FhirClient("http://localhost:4178");
                server.OnAfterResponse += (sender, args) =>
                {
                    base.Charset = args.RawResponse.CharacterSet;
                    foreach (string header in args.RawResponse.Headers.AllKeys)
                    {
                        base.Headers.Add(header, args.RawResponse.Headers[header]);
                    }
                };
                server.PreferredFormat = Hl7.Fhir.Rest.ResourceFormat.Json;
                string redirectedUrl = server.Endpoint.OriginalString.TrimEnd('/') + uri.PathAndQuery;
                System.Diagnostics.Trace.WriteLine($"{redirectedUrl}");
                var headers = new List <KeyValuePair <string, IEnumerable <string> > >();
                ModelBaseInputs <IServiceProvider> requestDetails = new ModelBaseInputs <IServiceProvider>(null, null, request.Method, uri, new Uri($"https://{AuthProtocolSchemeHandlerFactory.FhirFacadeAddress(_launchContext)}"), null, headers, null);
                if (request.Method == "GET")
                {
                    if (uri.LocalPath == "/metadata")
                    {
                        _facade.GetConformance(requestDetails, Rest.SummaryType.False).ContinueWith <CapabilityStatement>(r =>
                        {
                            if (r.Exception != null)
                            {
                                System.Diagnostics.Trace.WriteLine($"Error: {r.Exception.Message}");
                                if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                                {
                                    base.StatusCode = (int)fe.Status;
                                    if (fe.Outcome != null)
                                    {
                                        base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                                        {
                                            Pretty = true
                                        }).SerializeToBytes(fe.Outcome));
                                        base.MimeType = "application/fhir+json";
                                    }
                                    callback.Continue();
                                    System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                                    return(null);
                                }
                            }
                            base.StatusCode = 200;

                            // As per the documentation http://hl7.org/fhir/smart-app-launch/conformance/index.html
                            CapabilityStatement cs = r.Result;

                            // Update the security node with our internal security node
                            if (cs.Rest[0].Security == null)
                            {
                                cs.Rest[0].Security = new Hl7.Fhir.Model.CapabilityStatement.SecurityComponent();
                            }
                            Hl7.Fhir.Model.CapabilityStatement.SecurityComponent security = cs.Rest[0].Security;
                            if (!security.Service.Any(cc => cc.Coding.Any(c => c.System == "http://hl7.org/fhir/restful-security-service" && c.Code == "SMART-on-FHIR")))
                            {
                                security.Service.Add(new Hl7.Fhir.Model.CodeableConcept("http://hl7.org/fhir/restful-security-service", "SMART-on-FHIR"));
                            }
                            var extension = security.GetExtension("http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris");
                            if (extension == null)
                            {
                                extension = new Extension()
                                {
                                    Url = "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris"
                                };
                                security.Extension.Add(extension);
                            }
                            // remove the existing authentications, and put in our own
                            extension.Extension.Clear();
                            extension.AddExtension("token", new FhirUri($"https://{AuthProtocolSchemeHandlerFactory.AuthAddress(_launchContext)}/token"));
                            extension.AddExtension("authorize", new FhirUri($"https://{AuthProtocolSchemeHandlerFactory.AuthAddress(_launchContext)}/authorize"));

                            base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                            {
                                Pretty = true
                            }).SerializeToBytes(r.Result));
                            Console.WriteLine($"Success: {base.Stream.Length}");
                            base.MimeType = "application/fhir+json";
                            callback.Continue();
                            return(r.Result);
                        });
                        return(CefReturnValue.ContinueAsync);
                    }

                    if (!uri.LocalPath.StartsWith("/$") && !uri.LocalPath.StartsWith("/_") && uri.LocalPath.Length > 2)
                    {
                        // This is not an operation or history, so it must be a resource type
                        string resourceType = uri.LocalPath.Substring(1);
                        if (resourceType.Contains("/"))
                        {
                            resourceType = resourceType.Substring(0, resourceType.IndexOf("/"));
                        }
                        var rs = _facade.GetResourceService(requestDetails, resourceType);
                        if (rs == null)
                        {
                            System.Diagnostics.Trace.WriteLine($"Error: resource type not handled {resourceType}");
                            base.StatusCode = (int)HttpStatusCode.BadRequest;
                            //    base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings() { Pretty = true }).SerializeToBytes(fe.Outcome));
                            //    base.MimeType = "application/fhir+json";
                            callback.Continue();
                            return(CefReturnValue.Continue);
                        }

                        // GET for a specific resource
                        ResourceIdentity ri = new ResourceIdentity(uri);
                        if (ri.IsRestResourceIdentity())
                        {
                            rs.Get(ri.Id, ri.VersionId, SummaryType.False).ContinueWith(r =>
                            {
                                if (r.Exception != null)
                                {
                                    System.Diagnostics.Trace.WriteLine($"Error: {r.Exception.Message}");
                                    if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                                    {
                                        base.StatusCode = (int)fe.Status;
                                        if (fe.Outcome != null)
                                        {
                                            base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                                            {
                                                Pretty = true
                                            }).SerializeToBytes(fe.Outcome));
                                            base.MimeType = "application/fhir+json";
                                        }
                                        callback.Continue();
                                        System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                                        return(null);
                                    }
                                }
                                if (r.Result.HasAnnotation <HttpStatusCode>())
                                {
                                    base.StatusCode = (int)r.Result.Annotation <HttpStatusCode>();
                                }
                                else
                                {
                                    base.StatusCode = 200;
                                }

                                base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                                {
                                    Pretty = true
                                }).SerializeToBytes(r.Result));
                                Console.WriteLine($"Success: {base.Stream.Length}");
                                base.MimeType = "application/fhir+json";
                                callback.Continue();
                                return(r.Result);
                            });
                            return(CefReturnValue.ContinueAsync);
                        }

                        // Search for the resource type
                        var parameters = TupledParameters(uri, SearchQueryParameterNames);
                        int?pagesize   = GetIntParameter(uri, FhirParameter.COUNT);
                        var summary    = GetSummaryParameter(uri);
                        rs.Search(parameters, pagesize, summary).ContinueWith(r =>
                        {
                            if (r.Exception != null)
                            {
                                System.Diagnostics.Trace.WriteLine($"Error: {r.Exception.Message}");
                                if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                                {
                                    base.StatusCode = (int)fe.Status;
                                    if (fe.Outcome != null)
                                    {
                                        base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                                        {
                                            Pretty = true
                                        }).SerializeToBytes(fe.Outcome));
                                        base.MimeType = "application/fhir+json";
                                    }
                                    callback.Continue();
                                    System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                                    return(null);
                                }
                            }
                            if (r.Result.HasAnnotation <HttpStatusCode>())
                            {
                                base.StatusCode = (int)r.Result.Annotation <HttpStatusCode>();
                            }
                            else
                            {
                                base.StatusCode = 200;
                            }

                            base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                            {
                                Pretty = true
                            }).SerializeToBytes(r.Result));
                            Console.WriteLine($"Success: {base.Stream.Length}");
                            base.MimeType = "application/fhir+json";
                            callback.Continue();
                            return(r.Result);
                        });
                        return(CefReturnValue.ContinueAsync);
                    }

                    System.Threading.Tasks.Task <Hl7.Fhir.Model.Resource> t = server.GetAsync(redirectedUrl).ContinueWith <Hl7.Fhir.Model.Resource>(r =>
                    {
                        if (r.Exception != null)
                        {
                            System.Diagnostics.Trace.WriteLine($"Error: {r.Exception.Message}");
                            if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                            {
                                base.StatusCode = (int)fe.Status;
                                if (fe.Outcome != null)
                                {
                                    base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                                    {
                                        Pretty = true
                                    }).SerializeToBytes(fe.Outcome));
                                    base.MimeType = "application/fhir+json";
                                }
                                callback.Continue();
                                System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                                return(null);
                            }
                        }
                        base.StatusCode = 200;

                        if (r.Result is Hl7.Fhir.Model.CapabilityStatement cs)
                        {
                            // As per the documentation http://hl7.org/fhir/smart-app-launch/conformance/index.html

                            // Update the security node with our internal security node
                            if (cs.Rest[0].Security == null)
                            {
                                cs.Rest[0].Security = new Hl7.Fhir.Model.CapabilityStatement.SecurityComponent();
                            }
                            Hl7.Fhir.Model.CapabilityStatement.SecurityComponent security = cs.Rest[0].Security;
                            if (!security.Service.Any(cc => cc.Coding.Any(c => c.System == "http://hl7.org/fhir/restful-security-service" && c.Code == "SMART-on-FHIR")))
                            {
                                security.Service.Add(new Hl7.Fhir.Model.CodeableConcept("http://hl7.org/fhir/restful-security-service", "SMART-on-FHIR"));
                            }
                            var extension = security.GetExtension("http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris");
                            if (extension == null)
                            {
                                extension = new Extension()
                                {
                                    Url = "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris"
                                };
                                security.Extension.Add(extension);
                            }
                            // remove the existing authentications, and put in our own
                            extension.Extension.Clear();
                            extension.AddExtension("token", new FhirUri($"https://{AuthProtocolSchemeHandlerFactory.AuthAddress(_launchContext)}/token"));
                            extension.AddExtension("authorize", new FhirUri($"https://{AuthProtocolSchemeHandlerFactory.AuthAddress(_launchContext)}/authorize"));
                        }

                        base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                        {
                            Pretty = true
                        }).SerializeToBytes(r.Result));
                        Console.WriteLine($"Success: {base.Stream.Length}");
                        base.MimeType = "application/fhir+json";
                        callback.Continue();
                        return(r.Result);
                    });
                }
                if (request.Method == "POST")
                {
                    if (uri.LocalPath == "/")
                    {
                        Bundle b = null;
                        if (request.PostData != null)
                        {
                            var data = request.PostData.Elements.FirstOrDefault();
                            var body = data.GetBody();
                            if (request.GetHeaderByName("Content-Type").Contains("xml"))
                            {
                                b = new Hl7.Fhir.Serialization.FhirXmlParser().Parse <Bundle>(body);
                            }
                            else
                            {
                                b = new Hl7.Fhir.Serialization.FhirJsonParser().Parse <Bundle>(body);
                            }
                        }

                        _facade.ProcessBatch(requestDetails, b).ContinueWith(r =>
                        {
                            if (r.Exception != null)
                            {
                                System.Diagnostics.Trace.WriteLine($"Error: {r.Exception.Message}");
                                if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                                {
                                    base.StatusCode = (int)fe.Status;
                                    if (fe.Outcome != null)
                                    {
                                        base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                                        {
                                            Pretty = true
                                        }).SerializeToBytes(fe.Outcome));
                                        base.MimeType = "application/fhir+json";
                                    }
                                    callback.Continue();
                                    System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                                    return(null);
                                }
                            }
                            if (r.Result.HasAnnotation <HttpStatusCode>())
                            {
                                base.StatusCode = (int)r.Result.Annotation <HttpStatusCode>();
                            }
                            else
                            {
                                base.StatusCode = 200;
                            }

                            base.Stream = new MemoryStream(new Hl7.Fhir.Serialization.FhirJsonSerializer(new Hl7.Fhir.Serialization.SerializerSettings()
                            {
                                Pretty = true
                            }).SerializeToBytes(r.Result));
                            Console.WriteLine($"Success: {base.Stream.Length}");
                            base.MimeType = "application/fhir+json";
                            callback.Continue();
                            return(r.Result);
                        });
                        return(CefReturnValue.ContinueAsync);
                    }

                    System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
                    client.DefaultRequestHeaders.Add("Accept", request.GetHeaderByName("Accept"));
                    // client.DefaultRequestHeaders.Add("Content-Type", request.GetHeaderByName("Content-Type"));
                    HttpContent content = null;
                    if (request.PostData != null)
                    {
                        var data = request.PostData.Elements.FirstOrDefault();
                        var body = data.GetBody();
                        content = new System.Net.Http.StringContent(body, System.Text.Encoding.UTF8, request.GetHeaderByName("Content-Type"));
                    }
                    else
                    {
                        content = new System.Net.Http.StreamContent(null);
                    }
                    client.PostAsync(redirectedUrl, content).ContinueWith((System.Threading.Tasks.Task <HttpResponseMessage> r) =>
                    {
                        if (r.Exception != null)
                        {
                            Console.WriteLine($"Error: {r.Exception.Message}");
                            //if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                            //{
                            //    base.StatusCode = (int)fe.Status;
                            //    if (fe.Outcome != null)
                            //        base.Stream = new MemoryStream(r.Result.Content.ReadAsStringAsync().GetAwaiter().GetResult());
                            //    callback.Continue();
                            //    System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                            //    return;
                            //}
                        }
                        base.StatusCode = (int)r.Result.StatusCode;

                        base.Stream = r.Result.Content.ReadAsStreamAsync().GetAwaiter().GetResult();
                        Console.WriteLine($"Success: {base.Stream.Length}");
                        base.MimeType = r.Result.Content.Headers.ContentType.MediaType;
                        callback.Continue();
                        return;
                    });
                }
                if (request.Method == "PUT")
                {
                    System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
                    client.DefaultRequestHeaders.Add("Accept", request.GetHeaderByName("Accept"));
                    // client.DefaultRequestHeaders.Add("Content-Type", request.GetHeaderByName("Content-Type"));
                    HttpContent content = null;
                    if (request.PostData != null)
                    {
                        var data = request.PostData.Elements.FirstOrDefault();
                        var body = data.GetBody();
                        content = new System.Net.Http.StringContent(body, System.Text.Encoding.UTF8, request.GetHeaderByName("Content-Type"));
                    }
                    else
                    {
                        content = new System.Net.Http.StreamContent(null);
                    }
                    client.PutAsync(redirectedUrl, content).ContinueWith((System.Threading.Tasks.Task <HttpResponseMessage> r) =>
                    {
                        if (r.Exception != null)
                        {
                            Console.WriteLine($"Error: {r.Exception.Message}");
                            //if (r.Exception.InnerException is Hl7.Fhir.Rest.FhirOperationException fe)
                            //{
                            //    base.StatusCode = (int)fe.Status;
                            //    if (fe.Outcome != null)
                            //        base.Stream = new MemoryStream(r.Result.Content.ReadAsStringAsync().GetAwaiter().GetResult());
                            //    callback.Continue();
                            //    System.Diagnostics.Trace.WriteLine($"Error (inner): {fe.Message}");
                            //    return;
                            //}
                        }
                        base.StatusCode = (int)r.Result.StatusCode;

                        base.Stream = r.Result.Content.ReadAsStreamAsync().GetAwaiter().GetResult();
                        Console.WriteLine($"Success: {base.Stream.Length}");
                        base.MimeType = r.Result.Content.Headers.ContentType.MediaType;
                        callback.Continue();
                        return;
                    });
                }
                return(CefReturnValue.ContinueAsync);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"{ex.Message}");
                callback.Dispose();
                return(CefReturnValue.Cancel);
            }
        }
예제 #51
-7
        public void sendPost()
        {
            // Définition des variables qui seront envoyés
            HttpContent stringContent1 = new StringContent(param1String); // Le contenu du paramètre P1
            HttpContent stringContent2 = new StringContent(param2String); // Le contenu du paramètre P2
            HttpContent fileStreamContent = new StreamContent(paramFileStream);
            //HttpContent bytesContent = new ByteArrayContent(paramFileBytes);

            using (var client = new HttpClient())
            using (var formData = new MultipartFormDataContent())
            {
                formData.Add(stringContent1, "P1"); // Le paramètre P1 aura la valeur contenue dans param1String
                formData.Add(stringContent2, "P2"); // Le parmaètre P2 aura la valeur contenue dans param2String
                formData.Add(fileStreamContent, "FICHIER", "RETURN.xml");
                //  formData.Add(bytesContent, "file2", "file2");
                try
                {
                    var response = client.PostAsync(actionUrl, formData).Result;
                    MessageBox.Show(response.ToString());
                    if (!response.IsSuccessStatusCode)
                    {
                        MessageBox.Show("Erreur de réponse");
                    }
                }
                catch (Exception Error)
                {
                    MessageBox.Show(Error.Message);
                }
                finally
                {
                    client.CancelPendingRequests();
                }
            }
        }