[英]How to send chunked HTTP request from client side javascript (not from Nodejs)?
我找不到從客戶端javascript啟動和管理分塊請求的任何方法(無論是瀏覽器還是React Native)。
相反,Node.js提供了http模塊,您可以使用該模塊執行相同的任務並逐步write()
請求主體。
我的問題:反正有從客戶端javascript啟動分塊的HTTP請求嗎?
注意:這個問題不是關於接收分塊的響應 。 我想發送一個分塊的請求 。
例:
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);
我建議您通過以下鏈接,它可能會幫助您https://gist.github.com/CMCDragonkai/6bfade6431e9ffb7fe88 在此處輸入鏈接描述
希望這會把你清除掉!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.