2023-02-03 21:50:05 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Kenneth Myhra <kennethmyhra@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibWeb/XHR/FormData.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2023-04-02 21:32:23 +02:00
|
|
|
struct SerializedFormData {
|
|
|
|
String boundary;
|
|
|
|
ByteBuffer serialized_data;
|
|
|
|
};
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
WebIDL::ExceptionOr<XHR::FormDataEntry> create_entry(JS::Realm& realm, String const& name, Variant<GC::Ref<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
|
|
|
|
WebIDL::ExceptionOr<Optional<Vector<XHR::FormDataEntry>>> construct_entry_list(JS::Realm&, HTMLFormElement&, GC::Ptr<HTMLElement> submitter = nullptr, Optional<String> encoding = Optional<String> {});
|
2023-06-18 15:08:15 +01:00
|
|
|
ErrorOr<String> normalize_line_breaks(StringView value);
|
2023-04-02 21:32:23 +02:00
|
|
|
ErrorOr<SerializedFormData> serialize_to_multipart_form_data(Vector<XHR::FormDataEntry> const& entry_list);
|
2023-02-03 21:50:05 +01:00
|
|
|
|
|
|
|
}
|