IXWebSocket
IXWebSocket copied to clipboard
HTTP Chunked Transfer-Encoding support
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:
- 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 toHttpRequestArgsPtr request
argument? - if I am using
onChunkCallback
to process incoming data, what is the purpose ofOnResponseCallback
?
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 @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.
This isn't supported now. You can try to make PR if you're like to add support for it.
Stale issue message