AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
HttpPut.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_LIBCURLUTILS_HTTPPUT_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_LIBCURLUTILS_HTTPPUT_H_
18 
19 #include <memory>
20 #include <mutex>
21 #include <string>
22 
23 #include <curl/curl.h>
24 
27 
28 namespace alexaClientSDK {
29 namespace avsCommon {
30 namespace utils {
31 namespace libcurlUtils {
32 
34 class HttpPut : public HttpPutInterface {
35 public:
41  static std::unique_ptr<HttpPut> create();
42 
46  ~HttpPut() = default;
47 
53  HttpPut(const HttpPut& rhs) = delete;
54 
61  HttpPut& operator=(const HttpPut& rhs) = delete;
62 
63  HTTPResponse doPut(const std::string& url, const std::vector<std::string>& headers, const std::string& data)
64  override;
65 
66 private:
70  HttpPut() = default;
71 
73  std::mutex m_mutex;
74 
76  CurlEasyHandleWrapper m_curl;
77 };
78 
79 } // namespace libcurlUtils
80 } // namespace utils
81 } // namespace avsCommon
82 } // namespace alexaClientSDK
83 
84 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_LIBCURLUTILS_HTTPPUT_H_
HTTPResponse doPut(const std::string &url, const std::vector< std::string > &headers, const std::string &data) override
::std::string string
Definition: gtest-port.h:1097
HttpPut & operator=(const HttpPut &rhs)=delete
Minimal interface for making HTTP PUT requests.
Definition: HttpPutInterface.h:30
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
LIBCURL based implementation of HttpPutInterface.
Definition: HttpPut.h:34
static std::unique_ptr< HttpPut > create()

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0