handle readablestream objects as the request payload

This commit is contained in:
ading2210 2024-07-10 23:54:45 -07:00
parent 31e4e25f82
commit 7b195665e0

View file

@ -149,6 +149,9 @@ class HTTPSession extends CurlSession {
static async create_options(params) {
let body = null;
if (params.body instanceof ReadableStream) {
params.duplex = "half";
}
let request_obj = new Request("http://127.0.0.1/", params);
let array_buffer = await request_obj.arrayBuffer();
if (array_buffer.byteLength > 0) {