AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost Class Reference

LIBCURL based implementation of HttpPostInterface. More...

#include <HttpPost.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost:
Collaboration graph
[legend]

Public Member Functions

 ~HttpPost ()=default
 
 HttpPost (const HttpPost &rhs)=delete
 
HttpPostoperator= (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
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPostInterface
virtual ~HttpPostInterface ()=default
 Virtual destructor to assure proper cleanup of derived types. More...
 

Static Public Member Functions

static std::unique_ptr< HttpPostInterfacecreateHttpPostInterface ()
 
static std::unique_ptr< HttpPostcreate ()
 

Detailed Description

LIBCURL based implementation of HttpPostInterface.

Constructor & Destructor Documentation

◆ ~HttpPost()

alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::~HttpPost ( )
default

HttpPost destructor

◆ HttpPost()

alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost::HttpPost ( const HttpPost rhs)
delete

Deleted copy constructor.

Parameters
rhsThe 'right hand side' to not copy.

Member Function Documentation

◆ 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

Create a new HttpPost instance returned as an HttpPostInterface.

Returns
Returns an std::unique_ptr to the new HttpPost instance, or nullptr of the operation failed.

◆ 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
urlThe URL to send the POST to.
dataThe POST data to send in the request.
timeoutThe maximum amount of time (in seconds) to wait for the request to complete.
[out]bodyA 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
urlThe URL to send the POST to.
headerLinesvector of strings to add as header lines.
dataKey, value pairs describing the POST data to send in the request. This keys and values will be URL encoded by this method.
timeoutThe 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
urlThe URL to send the POST to.
headerLinesvector of strings to add as header lines.
dataA string containing the POST data to send in the request.
timeoutThe 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
rhsThe 'right hand side' to not copy.
Returns
The object assigned to.

The documentation for this class was generated from the following file:

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