DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
HttpRequestMessage.cpp
Go to the documentation of this file.
1#include "pch.h"
3
4namespace DotNetDupe {
5 namespace System {
6 namespace Net {
7 namespace Http {
8
10 : m_method(HttpMethod::Get), m_requestUri("http://localhost"), m_pContent(nullptr) {
12 }
13
14 HttpRequestMessage::HttpRequestMessage(const HttpMethod& method, const Uri& requestUri)
15 : m_method(method), m_requestUri(requestUri), m_pContent(nullptr) {
17 }
18
20 : m_method(method), m_requestUri(Uri(requestUri)), m_pContent(nullptr) {
22 }
23
26 return m_method;
27 }
28
31 m_method = method;
32 }
33
36 return m_requestUri;
37 }
38
39 void HttpRequestMessage::SetRequestUri(const Uri& requestUri) {
41 m_requestUri = requestUri;
42 }
43
46 return m_pContent;
47 }
48
51 m_pContent = content;
52 }
53
58
63
64 }
65 }
66 }
67}
Represents an HTTP request message adhering to RFC 9110 and RFC 9112.
Represents a collection of keys and values.
Definition Dictionary.h:66
A helper class for retrieving and comparing standard HTTP methods.
Definition HttpMethod.h:19
HttpRequestMessage()
Initializes a new instance of HttpRequestMessage with default GET method and localhost URI.
void SetRequestUri(const Uri &requestUri)
Sets the Uri used for the HTTP request.
HttpMethod GetMethod() const
Gets the HTTP method used by the HTTP request message.
Collections::Generic::Dictionary< String, String > & GetHeaders()
Gets the collection of HTTP request headers.
HttpContentPtr GetContent() const
Gets the contents of the HTTP message.
Uri GetRequestUri() const
Gets the Uri used for the HTTP request.
void SetContent(const HttpContentPtr &content)
Sets the contents of the HTTP message.
void SetMethod(const HttpMethod &method)
Sets the HTTP method used by the HTTP request message.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
Represents an object representation of a Uniform Resource Identifier (URI) and provides easy access t...
Definition Uri.h:21
SmartPointer< HttpContent > HttpContentPtr
Type alias for reference-counted SmartPointer to HttpContent.
Definition HttpContent.h:66