fetch-response-url-encoded.html 540 B

1234567891011121314151617
  1. <script src="../include.js"></script>
  2. <script>
  3. test(() => {
  4. const data = "param-a=value-a&param-b=value-b&param-c=value-c1&param-c=value-c2";
  5. const response = new Response(data, {
  6. headers: {
  7. "Content-Type": "application/x-www-form-urlencoded",
  8. },
  9. });
  10. response.formData().then((formData) => {
  11. println(formData.get("param-a"));
  12. println(formData.get("param-b"));
  13. println(formData.getAll("param-c"));
  14. });
  15. });
  16. </script>