diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:15:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:15:43 +0000 |
commit | f5f56e1a1c4d9e9496fcb9d81131066a964ccd23 (patch) | |
tree | 49e44c6f87febed37efb953ab5485aa49f6481a7 /src/lib/http/post_request.h | |
parent | Initial commit. (diff) | |
download | isc-kea-upstream.tar.xz isc-kea-upstream.zip |
Adding upstream version 2.4.1.upstream/2.4.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib/http/post_request.h')
-rw-r--r-- | src/lib/http/post_request.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/lib/http/post_request.h b/src/lib/http/post_request.h new file mode 100644 index 0000000..095fdab --- /dev/null +++ b/src/lib/http/post_request.h @@ -0,0 +1,53 @@ +// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC") +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef HTTP_POST_REQUEST_H +#define HTTP_POST_REQUEST_H + +#include <http/request.h> +#include <boost/shared_ptr.hpp> + +namespace isc { +namespace http { + +class PostHttpRequest; + +/// @brief Pointer to @ref PostHttpRequest. +typedef boost::shared_ptr<PostHttpRequest> PostHttpRequestPtr; +/// @brief Pointer to const @ref PostHttpRequest. +typedef boost::shared_ptr<const PostHttpRequest> ConstPostHttpRequestPtr; + +/// @brief Represents HTTP POST request. +/// +/// Instructs the parent class to require: +/// - HTTP POST message type, +/// - Content-Length header, +/// - Content-Type header. +class PostHttpRequest : public HttpRequest { +public: + + /// @brief Constructor for inbound HTTP request. + PostHttpRequest(); + + /// @brief Constructor for outbound HTTP request. + /// + /// @param method HTTP method, e.g. POST. + /// @param uri URI. + /// @param version HTTP version. + /// @param host_header Host header to be included in the request. The default + /// is the empty Host header. + /// @param basic_auth Basic HTTP authentication credential. The default + /// is no authentication. + PostHttpRequest(const Method& method, const std::string& uri, const HttpVersion& version, + const HostHttpHeader& host_header = HostHttpHeader(), + const BasicHttpAuthPtr& basic_auth = BasicHttpAuthPtr()); +}; + + +} // namespace http +} // namespace isc + +#endif |