16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_HTTPCONTENT_H_ 17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_HTTPCONTENT_H_ 44 std::future<long> httpStatusCode,
45 std::future<std::string> httpContentType,
46 std::shared_ptr<avsCommon::avs::attachment::InProcessAttachment> stream);
69 bool isReady(
const std::chrono::milliseconds timeout)
const;
83 std::shared_ptr<avsCommon::avs::attachment::InProcessAttachment>
getDataStream();
87 mutable std::shared_future<long> m_statusCode;
90 std::shared_future<std::string> m_contentType;
93 std::shared_ptr<avsCommon::avs::attachment::InProcessAttachment> m_dataStream;
97 std::future<long> httpStatusCode,
98 std::future<std::string> httpContentType,
99 std::shared_ptr<avsCommon::avs::attachment::InProcessAttachment> stream) :
101 m_contentType{
std::move(httpContentType)},
102 m_dataStream{stream} {};
105 auto statusCodeFuture = m_statusCode;
106 return statusCodeFuture.get();
111 return (statusCode >= 200) && (statusCode < 300);
115 auto statusCodeFuture = m_statusCode;
116 auto status = statusCodeFuture.wait_for(timeout);
117 return std::future_status::ready == status;
121 auto contentTypeFuture = m_contentType;
122 return contentTypeFuture.get();
133 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_HTTPCONTENT_H_ std::shared_ptr< avsCommon::avs::attachment::InProcessAttachment > getDataStream()
Definition: HTTPContent.h:125
::std::string string
Definition: gtest-port.h:1097
std::string getContentType()
Definition: HTTPContent.h:120
Definition: HTTPContent.h:34
bool isReady(const std::chrono::milliseconds timeout) const
Definition: HTTPContent.h:114
HTTPContent(std::future< long > httpStatusCode, std::future< std::string > httpContentType, std::shared_ptr< avsCommon::avs::attachment::InProcessAttachment > stream)
Definition: HTTPContent.h:96
bool isStatusCodeSuccess()
Definition: HTTPContent.h:109
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
long getStatusCode()
Definition: HTTPContent.h:104
const T & move(const T &t)
Definition: gtest-port.h:1317