LIBCURL based implementation of HttpPostInterface.
More...
#include <HttpPost.h>
|
| ~HttpPost ()=default |
|
| HttpPost (const HttpPost &rhs)=delete |
|
HttpPost & | operator= (const HttpPost &rhs)=delete |
|
long | doPost (const std::string &url, const std::string &data, std::chrono::seconds timeout, std::string &body) override |
|
HTTPResponse | doPost (const std::string &url, const std::vector< std::string > headerLines, const std::vector< std::pair< std::string, std::string >> &data, std::chrono::seconds timeout) override |
|
HTTPResponse | doPost (const std::string &url, const std::vector< std::string > headerLines, const std::string &data, std::chrono::seconds timeout) override |
|
virtual | ~HttpPostInterface ()=default |
| Virtual destructor to assure proper cleanup of derived types. More...
|
|
LIBCURL based implementation of HttpPostInterface.
◆ ~HttpPost()
alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::~HttpPost |
( |
| ) |
|
|
default |
◆ HttpPost()
alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::HttpPost |
( |
const HttpPost & |
rhs | ) |
|
|
delete |
Deleted copy constructor.
- Parameters
-
rhs | The 'right hand side' to not copy. |
◆ create()
static std::unique_ptr<HttpPost> alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::create |
( |
| ) |
|
|
static |
Create a new HttpPost instance, passing ownership of the new instance on to the caller.
- Deprecated:
- Returns
- Returns an std::unique_ptr to the new HttpPost instance, or
nullptr
of the operation failed.
◆ createHttpPostInterface()
static std::unique_ptr<HttpPostInterface> alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::createHttpPostInterface |
( |
| ) |
|
|
static |
◆ doPost() [1/3]
long alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::doPost |
( |
const std::string & |
url, |
|
|
const std::string & |
data, |
|
|
std::chrono::seconds |
timeout, |
|
|
std::string & |
body |
|
) |
| |
|
overridevirtual |
Perform an HTTP Post request returning the response body as a string. This method blocks for the duration of the request.
- Parameters
-
| url | The URL to send the POST to. |
| data | The POST data to send in the request. |
| timeout | The maximum amount of time (in seconds) to wait for the request to complete. |
[out] | body | A string to receive the body of the request if there is one. |
- Returns
- A HttpStatus indicating the disposition of the Post request.
Implements alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPostInterface.
◆ doPost() [2/3]
HTTPResponse alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::doPost |
( |
const std::string & |
url, |
|
|
const std::vector< std::string > |
headerLines, |
|
|
const std::vector< std::pair< std::string, std::string >> & |
data, |
|
|
std::chrono::seconds |
timeout |
|
) |
| |
|
overridevirtual |
Perform an HTTP Post request returning the response body as a string. This method blocks for the duration of the request.
- Parameters
-
url | The URL to send the POST to. |
headerLines | vector of strings to add as header lines. |
data | Key, value pairs describing the POST data to send in the request. This keys and values will be URL encoded by this method. |
timeout | The maximum amount of time (in seconds) to wait for the request to complete. |
- Returns
- An object describing the response to the request.
Implements alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPostInterface.
◆ doPost() [3/3]
HTTPResponse alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::doPost |
( |
const std::string & |
url, |
|
|
const std::vector< std::string > |
headerLines, |
|
|
const std::string & |
data, |
|
|
std::chrono::seconds |
timeout |
|
) |
| |
|
overridevirtual |
Perform an HTTP Post request returning the response body as a string. This method blocks for the duration of the request.
- Parameters
-
url | The URL to send the POST to. |
headerLines | vector of strings to add as header lines. |
data | A string containing the POST data to send in the request. |
timeout | The maximum amount of time (in seconds) to wait for the request to complete. |
- Returns
- An object describing the response to the request.
Implements alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPostInterface.
◆ operator=()
HttpPost& alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::operator= |
( |
const HttpPost & |
rhs | ) |
|
|
delete |
Deleted assignment operator.
- Parameters
-
rhs | The 'right hand side' to not copy. |
- Returns
- The object assigned to.
The documentation for this class was generated from the following file:
- /workplace/avs-device-sdk/AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/HttpPost.h
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0