mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 22:40:01 -04:00
fix handling of request bodies
This commit is contained in:
parent
3a50060e07
commit
5e9f26f818
6 changed files with 32 additions and 8 deletions
10
client/tests/scripts/test_post.js
Normal file
10
client/tests/scripts/test_post.js
Normal 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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue