azure-core
Public Member Functions | List of all members
Azure::Core::Http::Request Class Referencefinal

A request message from a client to a server. More...

#include <http.hpp>

Public Member Functions

 Request (HttpMethod httpMethod, Url url, Azure::Core::IO::BodyStream *bodyStream, bool shouldBufferResponse)
 Construct an Azure::Core::Http::Request. More...
 
 Request (HttpMethod httpMethod, Url url, Azure::Core::IO::BodyStream *bodyStream)
 Constructs a Request. More...
 
 Request (HttpMethod httpMethod, Url url, bool shouldBufferResponse)
 Constructs a Request. More...
 
 Request (HttpMethod httpMethod, Url url)
 Constructs a Request. More...
 
void SetHeader (std::string const &name, std::string const &value)
 Set an HTTP header to the Azure::Core::Http::Request. More...
 
Azure::Nullable< std::string > GetHeader (std::string const &name)
 Gets a specific HTTP header from an Azure::Core::Http::Request. More...
 
void RemoveHeader (std::string const &name)
 Remove an HTTP header. More...
 
HttpMethod const & GetMethod () const
 Get HttpMethod. More...
 
CaseInsensitiveMap GetHeaders () const
 Get HTTP headers. More...
 
Azure::Core::IO::BodyStreamGetBodyStream ()
 Get HTTP body as Azure::Core::IO::BodyStream. More...
 
bool ShouldBufferResponse ()
 A value indicating whether the returned raw response for this request will be buffered within a memory buffer or if it will be returned as a body stream instead.
 
UrlGetUrl ()
 Get URL. More...
 
Url const & GetUrl () const
 Get URL. More...
 

Detailed Description

Includes, within the first line of the message, the HttpMethod to be applied to the resource, the URL of the resource, and the protocol version in use.

Constructor & Destructor Documentation

◆ Request() [1/4]

Azure::Core::Http::Request::Request ( HttpMethod  httpMethod,
Url  url,
Azure::Core::IO::BodyStream bodyStream,
bool  shouldBufferResponse 
)
inlineexplicit
Parameters
httpMethodHttpMethod.
urlRequest URL.
bodyStreamAzure::Core::IO::BodyStream.
shouldBufferResponseA boolean value indicating whether the returned response should be buffered or returned as a body stream instead.

◆ Request() [2/4]

Azure::Core::Http::Request::Request ( HttpMethod  httpMethod,
Url  url,
Azure::Core::IO::BodyStream bodyStream 
)
inlineexplicit
Parameters
httpMethodHTTP method.
urlRequest URL.
bodyStreamAzure::Core::IO::BodyStream.

◆ Request() [3/4]

Request::Request ( HttpMethod  httpMethod,
Url  url,
bool  shouldBufferResponse 
)
explicit
Parameters
httpMethodHTTP method.
urlRequest URL.
shouldBufferResponseA boolean value indicating whether the returned response should be buffered or returned as a body stream instead.

◆ Request() [4/4]

Request::Request ( HttpMethod  httpMethod,
Url  url 
)
explicit
Parameters
httpMethodHTTP method.
urlRequest URL.

Member Function Documentation

◆ GetBodyStream()

Azure::Core::IO::BodyStream* Azure::Core::Http::Request::GetBodyStream ( )
inline

◆ GetHeader()

Azure::Nullable< std::string > Request::GetHeader ( std::string const &  name)
Parameters
nameThe name for the header to be retrieved.
Returns
The desired header, or an empty nullable if it is not found..
Exceptions
ifname is an invalid header key.

◆ GetHeaders()

Azure::Core::CaseInsensitiveMap Request::GetHeaders ( ) const
Remarks
Note that this function return a COPY of the headers for this request.

◆ GetMethod()

HttpMethod const & Request::GetMethod ( ) const

◆ GetUrl() [1/2]

Url& Azure::Core::Http::Request::GetUrl ( )
inline

◆ GetUrl() [2/2]

Url const& Azure::Core::Http::Request::GetUrl ( ) const
inline

◆ RemoveHeader()

void Request::RemoveHeader ( std::string const &  name)
Parameters
nameHTTP header name.

◆ SetHeader()

void Request::SetHeader ( std::string const &  name,
std::string const &  value 
)
Remarks
If the header key does not exists, it is added.
Parameters
nameThe name for the header to be set or added.
valueThe value for the header to be set or added.
Exceptions
ifname is an invalid header key.

The documentation for this class was generated from the following files: