HttpProtocol.cpp 799 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <AK/Badge.h>
  7. #include <AK/ByteBuffer.h>
  8. #include <AK/HashMap.h>
  9. #include <AK/OwnPtr.h>
  10. #include <AK/String.h>
  11. #include <AK/URL.h>
  12. #include <RequestServer/ConnectionFromClient.h>
  13. #include <RequestServer/HttpCommon.h>
  14. #include <RequestServer/HttpProtocol.h>
  15. #include <RequestServer/Request.h>
  16. namespace RequestServer {
  17. HttpProtocol::HttpProtocol()
  18. : Protocol("http")
  19. {
  20. }
  21. OwnPtr<Request> HttpProtocol::start_request(ConnectionFromClient& client, const String& method, const URL& url, const HashMap<String, String>& headers, ReadonlyBytes body)
  22. {
  23. return Detail::start_request(Badge<HttpProtocol> {}, client, method, url, headers, body, get_pipe_for_request());
  24. }
  25. }