mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-14 14:50:03 -04:00
10 lines
No EOL
342 B
JavaScript
10 lines
No EOL
342 B
JavaScript
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");
|
|
} |