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

Minimal interface for making Http POST requests. More...

#include <HttpPostInterface.h>

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

Public Member Functions

virtual ~HttpPostInterface ()=default
 Virtual destructor to assure proper cleanup of derived types. More...
 
virtual long doPost (const std::string &url, const std::string &data, std::chrono::seconds timeout, std::string &body)=0
 
virtual 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)=0
 
virtual HTTPResponse doPost (const std::string &url, const std::vector< std::string > headerLines, const std::string &data, std::chrono::seconds timeout)=0
 

Detailed Description

Minimal interface for making Http POST requests.

Constructor & Destructor Documentation

◆ ~HttpPostInterface()

virtual alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPostInterface::~HttpPostInterface ( )
virtualdefault

Virtual destructor to assure proper cleanup of derived types.

Member Function Documentation

◆ doPost() [1/3]

virtual long alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPostInterface::doPost ( const std::string &  url,
const std::string &  data,
std::chrono::seconds  timeout,
std::string &  body 
)
pure virtual

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.

Implemented in alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost.

◆ doPost() [2/3]

virtual HTTPResponse alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPostInterface::doPost ( const std::string &  url,
const std::vector< std::string >  headerLines,
const std::string &  data,
std::chrono::seconds  timeout 
)
pure virtual

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.

Implemented in alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost.

◆ doPost() [3/3]

virtual HTTPResponse alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPostInterface::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 
)
pure virtual

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.

Implemented in alexaClientSDK::avsCommon::utils::libcurlUtils::HttpPost.


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

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