summaryrefslogtreecommitdiffstats
path: root/src/lib/http/post_request.h
blob: 095fdab7c9ee5f3802456b472893201903d28e95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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