Go to the documentation of this file.
19 namespace 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)
79 AZURE_ASSERT(m_bodyStream ==
nullptr);
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); }
166 return std::move(this->m_bodyStream);
173 std::vector<uint8_t>&
GetBody() {
return this->m_body; }
179 std::vector<uint8_t>
const&
GetBody()
const {
return this->m_body; }
BodyStream is used to read data to/from a service.
RawResponse & operator=(RawResponse const &)=delete
RawResponse cannot be assigned.
RawResponse & operator=(RawResponse &&)=delete
RawResponse cannot be moved into.
RawResponse(RawResponse &&response)=default
Constructs RawResponse by moving in another instance.
void SetBodyStream(std::unique_ptr< Azure::Core::IO::BodyStream > stream)
Set Azure::Core::IO::BodyStream for this HTTP response.
Definition: raw_response.cpp:27
~RawResponse()=default
Destructs RawResponse.
std::unique_ptr< Azure::Core::IO::BodyStream > ExtractBodyStream()
Get HTTP response body as Azure::Core::IO::BodyStream.
Definition: raw_response.hpp:163
RawResponse(RawResponse const &response)
Constructs RawResponse from another.
Definition: raw_response.hpp:72
HTTP status code definition.
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:173
std::vector< uint8_t > const & GetBody() const
Get HTTP response body as vector of bytes.
Definition: raw_response.hpp:179
Azure SDK abstractions.
Definition: azure_assert.hpp:55
RawResponse(int32_t majorVersion, int32_t minorVersion, HttpStatusCode statusCode, std::string const &reasonPhrase)
Constructs RawResponse.
Definition: raw_response.hpp:56
void SetHeader(std::string const &name, std::string const &value)
Set an HTTP header to the #RawResponse.
Definition: raw_response.cpp:22
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
A map<string, string> with case-insensitive key comparison.
CaseInsensitiveMap const & GetHeaders() const
Get HTTP response headers.
Definition: raw_response.cpp:20
std::string const & GetReasonPhrase() const
Get HTTP reason phrase code of the HTTP response.
Definition: raw_response.cpp:18
HttpStatusCode GetStatusCode() const
Get HTTP status code of the HTTP response.
Definition: raw_response.cpp:16
void SetBody(std::vector< uint8_t > body)
Set HTTP response body for this HTTP response.
Definition: raw_response.hpp:136
HttpStatusCode
Defines the possible HTTP status codes.
Definition: http_status_code.hpp:18