From 871b9e8d6dbe99348c28bc22eeaf6c52e12e577f Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Thu, 28 Oct 2021 10:02:01 -0700 Subject: [PATCH] Expose http request base constructor (#3002) * Expose http request base constructor * cl --- sdk/core/azure-core/CHANGELOG.md | 1 + sdk/core/azure-core/inc/azure/core/http/http.hpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 80884e3ed..ef7f61fd2 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -7,6 +7,7 @@ - Add the static libcurl transport adapter. - Add `NoSignal` option to the `CurlTransportAdapter`. - Add `ConnectionTimeout` option to the `CurlTransportAdapter`. +- Add `Azure::Core::Http::Request` constructor overload to support payload and non-buffered response. ### Breaking Changes diff --git a/sdk/core/azure-core/inc/azure/core/http/http.hpp b/sdk/core/azure-core/inc/azure/core/http/http.hpp index 458a6bdd2..7881b4e1c 100644 --- a/sdk/core/azure-core/inc/azure/core/http/http.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/http.hpp @@ -210,11 +210,12 @@ namespace Azure { namespace Core { namespace Http { // previously called void StartTry(); + public: /** * @brief Construct an #Azure::Core::Http::Request. * * @param httpMethod HttpMethod. - * @param url URL. + * @param url %Request URL. * @param bodyStream #Azure::Core::IO::BodyStream. * @param shouldBufferResponse A boolean value indicating whether the returned response should * be buffered or returned as a body stream instead. @@ -227,9 +228,9 @@ namespace Azure { namespace Core { namespace Http { : m_method(std::move(httpMethod)), m_url(std::move(url)), m_bodyStream(bodyStream), m_retryModeEnabled(false), m_shouldBufferResponse(shouldBufferResponse) { + AZURE_ASSERT_MSG(bodyStream, "The bodyStream pointer cannot be null."); } - public: /** * @brief Constructs a `%Request`. * @@ -240,7 +241,6 @@ namespace Azure { namespace Core { namespace Http { explicit Request(HttpMethod httpMethod, Url url, Azure::Core::IO::BodyStream* bodyStream) : Request(httpMethod, std::move(url), bodyStream, true) { - AZURE_ASSERT_MSG(bodyStream, "The bodyStream pointer cannot be null."); } /**