POSTResource.h 915 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/ByteBuffer.h>
  8. namespace Web::HTML {
  9. // https://html.spec.whatwg.org/multipage/browsing-the-web.html#post-resource
  10. struct POSTResource {
  11. // https://html.spec.whatwg.org/multipage/browsing-the-web.html#post-resource-request-body
  12. // A request body, a byte sequence or failure.
  13. // FIXME: Change type to hold failure state.
  14. Optional<ByteBuffer> request_body;
  15. enum class RequestContentType {
  16. ApplicationXWWWFormUrlencoded,
  17. MultipartFormData,
  18. TextPlain,
  19. };
  20. // https://html.spec.whatwg.org/multipage/browsing-the-web.html#post-resource-request-content-type
  21. // A request content-type, which is `application/x-www-form-urlencoded`, `multipart/form-data`, or `text/plain`.
  22. RequestContentType request_content_type {};
  23. };
  24. }