11
11
#include < algorithm>
12
12
#include < cassert>
13
13
14
- using Aws::Http::Standard::StandardHttpRequest;
15
- using Aws::Http::HeaderValueCollection;
16
- using Aws::Http::Scheme;
17
- using Aws::Http::URI;
18
- using Aws::Utils::StringUtils;
19
-
20
14
static const char * STANDARD_HTTP_REQUEST_LOG_TAG = " StandardHttpRequest" ;
21
15
22
- static bool IsDefaultPort (const URI& uri)
16
+ static bool IsDefaultPort (const Aws::Http:: URI& uri)
23
17
{
24
18
switch (uri.GetPort ())
25
19
{
26
20
case 80 :
27
- return uri.GetScheme () == Scheme::HTTP;
21
+ return uri.GetScheme () == Aws::Http:: Scheme::HTTP;
28
22
case 443 :
29
- return uri.GetScheme () == Scheme::HTTPS;
23
+ return uri.GetScheme () == Aws::Http:: Scheme::HTTPS;
30
24
default :
31
25
return false ;
32
26
}
33
27
}
34
28
35
- StandardHttpRequest::StandardHttpRequest (const URI& uri, HttpMethod method) :
29
+ Aws::Http::Standard:: StandardHttpRequest::StandardHttpRequest (const Aws::Http:: URI& uri, Aws::Http:: HttpMethod method) :
36
30
HttpRequest(uri, method),
37
31
bodyStream(nullptr ),
38
32
m_responseStreamFactory()
@@ -49,51 +43,51 @@ StandardHttpRequest::StandardHttpRequest(const URI& uri, HttpMethod method) :
49
43
}
50
44
}
51
45
52
- HeaderValueCollection StandardHttpRequest::GetHeaders () const
46
+ Aws::Http:: HeaderValueCollection Aws::Http::Standard:: StandardHttpRequest::GetHeaders () const
53
47
{
54
48
HeaderValueCollection headers;
55
49
56
- for (HeaderValueCollection::const_iterator iter = headerMap. begin (); iter != headerMap. end (); ++iter )
50
+ for (const auto & iter : headerMap)
57
51
{
58
- headers.emplace (HeaderValuePair (iter-> first , iter-> second ));
52
+ headers.emplace (HeaderValuePair (iter. first , iter. second ));
59
53
}
60
54
61
55
return headers;
62
56
}
63
57
64
- const Aws::String& StandardHttpRequest::GetHeaderValue (const char * headerName) const
58
+ const Aws::String& Aws::Http::Standard:: StandardHttpRequest::GetHeaderValue (const char * headerName) const
65
59
{
66
- auto iter = headerMap.find (StringUtils::ToLower (headerName));
60
+ auto iter = headerMap.find (Utils:: StringUtils::ToLower (headerName));
67
61
assert (iter != headerMap.end ());
68
62
if (iter == headerMap.end ()) {
69
- AWS_LOGSTREAM_ERROR (STANDARD_HTTP_REQUEST_LOG_TAG, " Requested a header value for a missing header key: " << headerName);
70
- static const Aws::String EMPTY_STRING = " " ;
63
+ AWS_LOGSTREAM_ERROR (STANDARD_HTTP_REQUEST_LOG_TAG, " Requested a header value for a missing header key: " << headerName)
64
+ static const Aws::String EMPTY_STRING;
71
65
return EMPTY_STRING;
72
66
}
73
67
return iter->second ;
74
68
}
75
69
76
- void StandardHttpRequest::SetHeaderValue (const char * headerName, const Aws::String& headerValue)
70
+ void Aws::Http::Standard:: StandardHttpRequest::SetHeaderValue (const char * headerName, const Aws::String& headerValue)
77
71
{
78
- headerMap[StringUtils::ToLower (headerName)] = StringUtils::Trim (headerValue.c_str ());
72
+ headerMap[Utils:: StringUtils::ToLower (headerName)] = Utils:: StringUtils::Trim (headerValue.c_str ());
79
73
}
80
74
81
- void StandardHttpRequest::SetHeaderValue (const Aws::String& headerName, const Aws::String& headerValue)
82
- {
83
- headerMap[StringUtils::ToLower (headerName.c_str ())] = StringUtils::Trim (headerValue.c_str ());
75
+ void Aws::Http::Standard:: StandardHttpRequest::SetHeaderValue (const Aws::String & headerName, const Aws::String & headerValue) {
76
+
77
+ headerMap[Utils:: StringUtils::ToLower (headerName.c_str ())] = Utils:: StringUtils::Trim (headerValue.c_str ());
84
78
}
85
79
86
- void StandardHttpRequest::DeleteHeader (const char * headerName)
80
+ void Aws::Http::Standard:: StandardHttpRequest::DeleteHeader (const char * headerName)
87
81
{
88
- headerMap.erase (StringUtils::ToLower (headerName));
82
+ headerMap.erase (Utils:: StringUtils::ToLower (headerName));
89
83
}
90
84
91
- bool StandardHttpRequest::HasHeader (const char * headerName) const
85
+ bool Aws::Http::Standard:: StandardHttpRequest::HasHeader (const char * headerName) const
92
86
{
93
- return headerMap.find (StringUtils::ToLower (headerName)) != headerMap.end ();
87
+ return headerMap.find (Utils:: StringUtils::ToLower (headerName)) != headerMap.end ();
94
88
}
95
89
96
- int64_t StandardHttpRequest::GetSize () const
90
+ int64_t Aws::Http::Standard:: StandardHttpRequest::GetSize () const
97
91
{
98
92
int64_t size = 0 ;
99
93
@@ -102,12 +96,12 @@ int64_t StandardHttpRequest::GetSize() const
102
96
return size;
103
97
}
104
98
105
- const Aws::IOStreamFactory& StandardHttpRequest::GetResponseStreamFactory () const
99
+ const Aws::IOStreamFactory& Aws::Http::Standard:: StandardHttpRequest::GetResponseStreamFactory () const
106
100
{
107
101
return m_responseStreamFactory;
108
102
}
109
103
110
- void StandardHttpRequest::SetResponseStreamFactory (const Aws::IOStreamFactory& factory)
104
+ void Aws::Http::Standard:: StandardHttpRequest::SetResponseStreamFactory (const Aws::IOStreamFactory& factory)
111
105
{
112
106
m_responseStreamFactory = factory;
113
107
}
0 commit comments