-// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2019 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
}
PostHttpRequest::PostHttpRequest(const Method& method, const std::string& uri,
- const HttpVersion& version)
- : HttpRequest(method, uri, version) {
+ const HttpVersion& version,
+ const HostHttpHeader& host_header)
+ : HttpRequest(method, uri, version, host_header) {
requireHttpMethod(Method::HTTP_POST);
requireHeader("Content-Length");
requireHeader("Content-Type");
-// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2019 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
/// @param method HTTP method, e.g. POST.
/// @param uri URI.
/// @param version HTTP version.
- PostHttpRequest(const Method& method, const std::string& uri, const HttpVersion& version);
+ /// @param host_header Host header to be included in the request. The default
+ /// is the empty Host header.
+ PostHttpRequest(const Method& method, const std::string& uri, const HttpVersion& version,
+ const HostHttpHeader& host_header = HostHttpHeader());
};
-// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2019 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
}
PostHttpRequestJson::PostHttpRequestJson(const Method& method, const std::string& uri,
- const HttpVersion& version)
- : PostHttpRequest(method, uri, version) {
+ const HttpVersion& version,
+ const HostHttpHeader& host_header)
+ : PostHttpRequest(method, uri, version, host_header) {
requireHeaderValue("Content-Type", "application/json");
context()->headers_.push_back(HttpHeaderContext("Content-Type", "application/json"));
}
-// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2019 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
/// @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.
explicit PostHttpRequestJson(const Method& method, const std::string& uri,
- const HttpVersion& version);
+ const HttpVersion& version,
+ const HostHttpHeader& host_header = HostHttpHeader());
/// @brief Complete parsing of the HTTP request.
///