Files
serenity/Tests/LibWeb/Text/input/Fetch/fetch-response-url-encoded.html
Kenneth Myhra 1d4e673e60 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'.

(cherry picked from commit b8fa572c6742c0f1f63da0f63c8b86835a86988d)
2024-07-23 13:06:46 -04:00

18 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>