4

I cannot find any way to start and manage a chunked request from client side javascript (whether it is a browser or React Native).

On the contrary Node.js provides the http module using which you can do the same task and write() the request body gradually.

My Question: Is there anyway to initiate a chunked HTTP request from client side javascript?

Note: That question is NOT about receiving a chunked response. I want to send a chunked request.

Example:

var http = new XMLHttpRequest();
var url = 'some_url';
var body = 'The whole body data';
http.open('POST', url, true);

// Whatever the content type
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');

// The whole data has to be ready and sent at once.
// How to stream the body? send it in chunks?
http.send(body);
Meena Alfons
  • 1,230
  • 2
  • 13
  • 30
  • Possible duplicate of [How to write javascript in client side to receive and parse \`chunked\` response in time?](https://stackoverflow.com/questions/6789703/how-to-write-javascript-in-client-side-to-receive-and-parse-chunked-response-i) – Doğancan Arabacı Jan 07 '19 at 09:08
  • 2
    No .. I do not want to receive a chunked **response**. I want to send a chunked **request**. – Meena Alfons Jan 07 '19 at 09:12

0 Answers0