fix handling of request bodies

This commit is contained in:
ading2210 2024-03-20 18:38:13 -04:00
parent 3a50060e07
commit 5e9f26f818
6 changed files with 32 additions and 8 deletions

View file

@ -0,0 +1,10 @@
async function test() {
let payload = "hello".repeat(100);
let r = await libcurl.fetch("https://httpbin.org/anything", {
method: "POST",
body: new Blob([payload], {type: "text/plain"})
});
assert(r.status === 200, "wrong status");
let json = await r.json();
assert(json.data === payload, "server reports wrong payload");
}