IXWebSocket icon indicating copy to clipboard operation
IXWebSocket copied to clipboard

HTTP Chunked Transfer-Encoding support

Open PasinduKollure opened this issue 2 years ago • 4 comments

I'm having trouble finding a way to send chunks of data to a server on a separate thread while handling incoming data on another separate thread (using onChunkCallback). I reviewed the Http Client API section of the usage.md file and I noticed that onResponseCallback parameter in the bool ix::HttpClient::performRequest(HttpRequestArgsPtr request, const OnResponseCallback& onResponseCallback) function can be used to handle responses but there is also another onChunkCallback variable in the HttpRequestArgs struct which also handles responses from a server. I'm not sure if both of these functions handle incoming messages, and if that is the case, why have 2 callbacks for the same purpose?

Summary of 2 Questions:

  1. Is it possible to send chunked data by calling performRequest(HttpRequestArgsPtr request, const OnResponseCallback& onResponseCallback); in a separate custom thread and will the http connection stay open if the header "Transfer-Encoding: chunked" is passed to HttpRequestArgsPtr request argument?
  2. if I am using onChunkCallback to process incoming data, what is the purpose of OnResponseCallback?

PasinduKollure avatar Apr 08 '22 17:04 PasinduKollure

Hi @PasinduKollure / currently I don't think that you can send chunked data, we can receive chunked data.

Are you trying to send data in small pieces ?

bsergean avatar Apr 12 '22 04:04 bsergean

Hi @PasinduKollure / currently I don't think that you can send chunked data, we can receive chunked data.

Are you trying to send data in small pieces ?

Hi @bsergean, I want to send chunked data in “transfer-encoding: chunked” since the endpoint is expecting the “transfer-encoding: chunked” header.

PasinduKollure avatar Apr 12 '22 05:04 PasinduKollure

This isn't supported now. You can try to make PR if you're like to add support for it.

bsergean avatar Apr 25 '22 22:04 bsergean

Stale issue message

github-actions[bot] avatar Jun 25 '22 00:06 github-actions[bot]