mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 22:40:01 -04:00
handle readablestream objects as the request payload
This commit is contained in:
parent
31e4e25f82
commit
7b195665e0
1 changed files with 3 additions and 0 deletions
|
@ -149,6 +149,9 @@ class HTTPSession extends CurlSession {
|
||||||
|
|
||||||
static async create_options(params) {
|
static async create_options(params) {
|
||||||
let body = null;
|
let body = null;
|
||||||
|
if (params.body instanceof ReadableStream) {
|
||||||
|
params.duplex = "half";
|
||||||
|
}
|
||||||
let request_obj = new Request("http://127.0.0.1/", params);
|
let request_obj = new Request("http://127.0.0.1/", params);
|
||||||
let array_buffer = await request_obj.arrayBuffer();
|
let array_buffer = await request_obj.arrayBuffer();
|
||||||
if (array_buffer.byteLength > 0) {
|
if (array_buffer.byteLength > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue