19namespace Azure {
namespace Core {
namespace Http {
27 int32_t m_majorVersion;
28 int32_t m_minorVersion;
30 std::string m_reasonPhrase;
33 std::unique_ptr<Azure::Core::IO::BodyStream> m_bodyStream;
34 std::vector<uint8_t> m_body;
40 std::string
const& reasonPhrase,
41 std::unique_ptr<Azure::Core::IO::BodyStream> BodyStream)
42 : m_majorVersion(majorVersion), m_minorVersion(minorVersion), m_statusCode(statusCode),
43 m_reasonPhrase(reasonPhrase), m_bodyStream(std::move(BodyStream))
60 std::string
const& reasonPhrase)
61 :
RawResponse(majorVersion, minorVersion, statusCode, reasonPhrase, nullptr)
74 response.m_majorVersion,
75 response.m_minorVersion,
76 response.m_statusCode,
77 response.m_reasonPhrase)
122 void SetHeader(std::string
const& name, std::string
const& value);
129 void SetBodyStream(std::unique_ptr<Azure::Core::IO::BodyStream> stream);
136 void SetBody(std::vector<uint8_t> body) { this->m_body = std::move(body); }
178 return std::move(this->m_bodyStream);
185 std::vector<uint8_t>&
GetBody() {
return this->m_body; }
191 std::vector<uint8_t>
const&
GetBody()
const {
return this->m_body; }
#define AZURE_ASSERT(exp)
Azure specific assert macro.
Definition azure_assert.hpp:51
BodyStream is used to read data to/from a service.
A map<string, string> with case-insensitive key comparison.
std::map< std::string, std::string, _internal::StringExtensions::CaseInsensitiveComparator > CaseInsensitiveMap
A type alias of std::map<std::string, std::string> with case-insensitive key comparison.
Definition case_insensitive_containers.hpp:24
After receiving and interpreting a request message, a server responds with an HTTP response message.
Definition raw_response.hpp:24
std::vector< uint8_t > & GetBody()
Get HTTP response body as vector of bytes.
Definition raw_response.hpp:185
HttpStatusCode GetStatusCode() const
Get HTTP status code of the HTTP response.
Definition raw_response.cpp:11
void SetBody(std::vector< uint8_t > body)
Set HTTP response body for this HTTP response.
Definition raw_response.hpp:136
void SetHeader(std::string const &name, std::string const &value)
Set an HTTP header to the Azure::Core::Http::RawResponse.
Definition raw_response.cpp:17
RawResponse(RawResponse &&response)=default
Constructs RawResponse by moving in another instance.
std::unique_ptr< Azure::Core::IO::BodyStream > ExtractBodyStream()
Get HTTP response body as Azure::Core::IO::BodyStream.
Definition raw_response.hpp:175
std::string const & GetReasonPhrase() const
Get HTTP reason phrase code of the HTTP response.
Definition raw_response.cpp:13
~RawResponse()=default
Destructs RawResponse.
CaseInsensitiveMap const & GetHeaders() const
Get HTTP response headers.
Definition raw_response.cpp:15
RawResponse(RawResponse const &response)
Constructs RawResponse from another.
Definition raw_response.hpp:72
RawResponse(int32_t majorVersion, int32_t minorVersion, HttpStatusCode statusCode, std::string const &reasonPhrase)
Constructs RawResponse.
Definition raw_response.hpp:56
int32_t GetMajorVersion() const
Get HTTP protocol major version.
Definition raw_response.hpp:145
int32_t GetMinorVersion() const
Get HTTP protocol minor version.
Definition raw_response.hpp:151
std::vector< uint8_t > const & GetBody() const
Get HTTP response body as vector of bytes.
Definition raw_response.hpp:191
void SetBodyStream(std::unique_ptr< Azure::Core::IO::BodyStream > stream)
Set Azure::Core::IO::BodyStream for this HTTP response.
Definition raw_response.cpp:22
RawResponse & operator=(RawResponse const &)=delete
RawResponse cannot be assigned.
RawResponse & operator=(RawResponse &&)=delete
RawResponse cannot be moved into.
HTTP status code definition.
HttpStatusCode
Defines the possible HTTP status codes.
Definition http_status_code.hpp:18
Compute the hash value for the input binary data, using SHA256, SHA384 and SHA512.
Definition azure_assert.hpp:57