ladybird/Tests/LibWeb/Text/input/Fetch/fetch-response-url-encoded.html
Kenneth Myhra b8fa572c67 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'.
2024-07-23 09:02:21 +02:00

17 lines
540 B
HTML

<script src="../include.js"></script>
<script>
test(() => {
const data = "param-a=value-a&param-b=value-b&param-c=value-c1&param-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>