mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-16 16:12:53 +00:00
The Response interface of the Fetch API can now parse form urlencoded bodies when Content-Type is set to 'application/x-www-form-urlencoded'.
17 lines
540 B
HTML
17 lines
540 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const data = "param-a=value-a¶m-b=value-b¶m-c=value-c1¶m-c=value-c2";
|
|
const response = new Response(data, {
|
|
headers: {
|
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
},
|
|
});
|
|
|
|
response.formData().then((formData) => {
|
|
println(formData.get("param-a"));
|
|
println(formData.get("param-b"));
|
|
println(formData.getAll("param-c"));
|
|
});
|
|
});
|
|
</script>
|