mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
LibWeb: Implement formData() method steps for x-www-form-urlencoded
The Response interface of the Fetch API can now parse form urlencoded bodies when Content-Type is set to 'application/x-www-form-urlencoded'.
This commit is contained in:
parent
7047fcf761
commit
b8fa572c67
Notes:
github-actions[bot]
2024-07-23 07:03:35 +00:00
Author: https://github.com/kennethmyhra
Commit: b8fa572c67
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/763
5 changed files with 46 additions and 6 deletions
|
@ -0,0 +1,17 @@
|
|||
<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>
|
Loading…
Add table
Add a link
Reference in a new issue