HttpHeaderProvider.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
11 
13 
14 /*--------------------------------------------------------------------------------------+
15 * @bsiclass Bentley Systems
16 +---------------+---------------+---------------+---------------+---------------+------*/
18 {
19 private:
20  HttpRequestHeaders m_headers;
21 
22 public:
24  {
25  return std::make_shared<HttpHeaderProvider> (headers);
26  };
27  HttpHeaderProvider(HttpRequestHeadersCR headers) : m_headers(headers){};
28  virtual ~HttpHeaderProvider(){};
29 
30  virtual void FillHttpRequestHeaders(HttpRequestHeaders& headersOut) const override
31  {
32  for (auto& pair : m_headers.GetMap())
33  {
34  headersOut.SetValue(pair.first, pair.second);
35  }
36  };
37 };
38 
#define BEGIN_BENTLEY_HTTP_NAMESPACE
Definition: Http.h:17
HttpHeaderProvider(HttpRequestHeadersCR headers)
Definition: HttpHeaderProvider.h:27
Definition: HttpHeaderProvider.h:17
Definition: IHttpHeaderProvider.h:18
Definition: HttpHeaders.h:64
HttpRequestHeaders const & HttpRequestHeadersCR
Definition: HttpHeaders.h:32
static IHttpHeaderProviderPtr Create(HttpRequestHeadersCR headers=HttpRequestHeaders())
Definition: HttpHeaderProvider.h:23
BEGIN_BENTLEY_HTTP_NAMESPACE typedef std::shared_ptr< struct IHttpHeaderProvider > IHttpHeaderProviderPtr
Definition: IHttpHeaderProvider.h:17
HttpHeaderMap const & GetMap() const
Definition: HttpHeaders.h:45
#define END_BENTLEY_HTTP_NAMESPACE
Definition: Http.h:18
BEHTTP_EXPORT void SetValue(Utf8StringCR field, Utf8StringCR value)
virtual void FillHttpRequestHeaders(HttpRequestHeaders &headersOut) const override
Definition: HttpHeaderProvider.h:30
virtual ~HttpHeaderProvider()
Definition: HttpHeaderProvider.h:28

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.