webclient

Stream upload 'POST' in Spring WebClient

亡梦爱人 提交于 2021-01-04 03:24:31
问题 I am uploading streams of (raw bytes) data using HTTP posts using WebClient: final byte[] rawData = IOUtils.toByteArray(sourceInputStream); webClient.post() .uri(uri) .contentType(MediaType.APPLICATION_OCTET_STREAM) .bodyValue(rawData) .exchange()... I am concerned there is a potentially a lot of memory used given sometimes these objects can be quite big (~200Mb) so would like to read directly from the InputStream and upload as a stream. I tried: bodyValue(BodyInserters.fromResource(new

C# HTTP post , how to post with List<XX> parameter?

孤街浪徒 提交于 2021-01-01 06:49:18
问题 using (WebClient wc = new WebClient()) { wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; string HtmlResult = wc.UploadString(url, "sign=fsadfasdf&charset=utf-8"); } Server can get value of sign and charset. But there is a third parameter LIST, which is a list of object (this object is an entity class). How can I pass this parameter to the server? I tried to use "sign=fsadfasdf&charset=hhh&list=" + Json(list) as postData (convert List to json string). But the

C# HTTP post , how to post with List<XX> parameter?

你离开我真会死。 提交于 2021-01-01 06:49:05
问题 using (WebClient wc = new WebClient()) { wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; string HtmlResult = wc.UploadString(url, "sign=fsadfasdf&charset=utf-8"); } Server can get value of sign and charset. But there is a third parameter LIST, which is a list of object (this object is an entity class). How can I pass this parameter to the server? I tried to use "sign=fsadfasdf&charset=hhh&list=" + Json(list) as postData (convert List to json string). But the

Multiple asynchronous download with progress bar

无人久伴 提交于 2020-12-16 04:14:04
问题 I'm trying to download folder from my web server and I want to display progress on progress bar with how many data was downloaded / total to download. First I've tried to use WebClient.DownloadFile . Which worked flawlessly, but it didn't trigger DownloadProgressChangedEventHandler . I guess it's activated only by async downloading. So I've rework my method to WebClient.DownloadFileAsync . This is where it gets complicated. For example, I have 30 files on my web server with size 53 MB. I want

Multiple asynchronous download with progress bar

走远了吗. 提交于 2020-12-16 04:12:59
问题 I'm trying to download folder from my web server and I want to display progress on progress bar with how many data was downloaded / total to download. First I've tried to use WebClient.DownloadFile . Which worked flawlessly, but it didn't trigger DownloadProgressChangedEventHandler . I guess it's activated only by async downloading. So I've rework my method to WebClient.DownloadFileAsync . This is where it gets complicated. For example, I have 30 files on my web server with size 53 MB. I want

WebClient doesn't read response until request write is completed.

不羁岁月 提交于 2020-12-04 00:41:00
问题 I'm trying to implement streaming proxy. I faced with the issue with WebClient from spring reactive. Could anyone help me to understand Do I some wrong way or it's just a bug from WebClient side? Stack: reactor-netty 0.7.8.RELEASE spring-boot 2.0.4.RELEASE Desc: I want to proxy a long stream to external service and then forward stream of responses to the requester. Streaming is happening using chunks (HTTP 1.1 Transfer-Encoding : chunked). External service processes every chunk and sends to

WebClient doesn't read response until request write is completed.

扶醉桌前 提交于 2020-12-04 00:40:24
问题 I'm trying to implement streaming proxy. I faced with the issue with WebClient from spring reactive. Could anyone help me to understand Do I some wrong way or it's just a bug from WebClient side? Stack: reactor-netty 0.7.8.RELEASE spring-boot 2.0.4.RELEASE Desc: I want to proxy a long stream to external service and then forward stream of responses to the requester. Streaming is happening using chunks (HTTP 1.1 Transfer-Encoding : chunked). External service processes every chunk and sends to

WebClient doesn't read response until request write is completed.

安稳与你 提交于 2020-12-04 00:38:21
问题 I'm trying to implement streaming proxy. I faced with the issue with WebClient from spring reactive. Could anyone help me to understand Do I some wrong way or it's just a bug from WebClient side? Stack: reactor-netty 0.7.8.RELEASE spring-boot 2.0.4.RELEASE Desc: I want to proxy a long stream to external service and then forward stream of responses to the requester. Streaming is happening using chunks (HTTP 1.1 Transfer-Encoding : chunked). External service processes every chunk and sends to

WebClient doesn't read response until request write is completed.

蓝咒 提交于 2020-12-04 00:38:17
问题 I'm trying to implement streaming proxy. I faced with the issue with WebClient from spring reactive. Could anyone help me to understand Do I some wrong way or it's just a bug from WebClient side? Stack: reactor-netty 0.7.8.RELEASE spring-boot 2.0.4.RELEASE Desc: I want to proxy a long stream to external service and then forward stream of responses to the requester. Streaming is happening using chunks (HTTP 1.1 Transfer-Encoding : chunked). External service processes every chunk and sends to

WebClient doesn't read response until request write is completed.

江枫思渺然 提交于 2020-12-04 00:38:02
问题 I'm trying to implement streaming proxy. I faced with the issue with WebClient from spring reactive. Could anyone help me to understand Do I some wrong way or it's just a bug from WebClient side? Stack: reactor-netty 0.7.8.RELEASE spring-boot 2.0.4.RELEASE Desc: I want to proxy a long stream to external service and then forward stream of responses to the requester. Streaming is happening using chunks (HTTP 1.1 Transfer-Encoding : chunked). External service processes every chunk and sends to