#include <cp_http_request_executor.hpp>
|
| template<typename TOrthogonal , typename TClient > |
| void | onComponentInitialization () |
| |
| template<typename EventType > |
| void | postEvent (const EventType &ev) |
| |
| template<typename EventType > |
| void | postEvent () |
| |
| template<typename TOrthogonal , typename TSourceObject > |
| void | onStateOrthogonalAllocation () |
| |
| template<typename TComponent > |
| void | requiresComponent (TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| |
| template<typename TComponent > |
| void | requiresComponent (std::string name, TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
| |
| template<typename TClient > |
| void | requiresClient (TClient *&requiredClientStorage) |
| |
| template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> |
| SmaccComponentType * | createSiblingComponent (TArgs... targs) |
| |
| template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> |
| SmaccComponentType * | createSiblingNamedComponent (std::string name, TArgs... targs) |
| |
| rclcpp::Node::SharedPtr | getNode () |
| |
| rclcpp::Logger | getLogger () const |
| |
| ISmaccStateMachine * | getStateMachine () |
| |
| ISmaccStateMachine * | stateMachine_ |
| |
| ISmaccClient * | owner_ |
| |
◆ TResponse
◆ HttpMethod
Definition at line 40 of file cp_http_request_executor.hpp.
41 {
42 GET =
static_cast<int>(boost::beast::http::verb::get),
43 POST =
static_cast<int>(boost::beast::http::verb::post),
44 PUT =
static_cast<int>(boost::beast::http::verb::put),
45 };
◆ CpHttpRequestExecutor()
| cl_http::CpHttpRequestExecutor::CpHttpRequestExecutor |
( |
| ) |
|
◆ ~CpHttpRequestExecutor()
| cl_http::CpHttpRequestExecutor::~CpHttpRequestExecutor |
( |
| ) |
|
|
virtual |
◆ executeRequest()
| void cl_http::CpHttpRequestExecutor::executeRequest |
( |
const HttpMethod | method, |
|
|
const std::string & | path = "/", |
|
|
const std::string & | body = "", |
|
|
const std::unordered_map< std::string, std::string > & | headers = {} ) |
Definition at line 41 of file cp_http_request_executor.cpp.
44{
45 auto path_used = path;
46 if (path.empty() || path[0] != '/')
47 {
48 path_used = "/" + path;
49 }
50
51 RCLCPP_INFO(
52 this->
getLogger(),
"Executing request: SSL=%d Server=%s Path=%s Port=%s",
55
58
59 session->setBody(body);
60 session->setHeaders(headers);
61 session->run(
64}
boost::asio::any_io_executor getStrand()
static constexpr int HTTP_VERSION
std::string getPort() const
std::string getServerName() const
std::shared_ptr< http_session_base > createSession(boost::asio::any_io_executor executor, std::function< void(const http_session_base::TResponse &)> callback)
rclcpp::Logger getLogger() const
References connectionManager_, cl_http::CpHttpSessionManager::createSession(), smacc2::ISmaccComponent::getLogger(), cl_http::CpHttpSessionManager::getPort(), cl_http::CpHttpSessionManager::getServerName(), cl_http::CpHttpConnectionManager::getStrand(), HTTP_VERSION, cl_http::CpHttpSessionManager::isSSL(), responseHandler_, and sessionManager_.
Referenced by cl_http::CbHttpRequestBase::onEntry().
◆ onInitialize()
| void cl_http::CpHttpRequestExecutor::onInitialize |
( |
| ) |
|
|
overridevirtual |
◆ setDependencies()
◆ connectionManager_
◆ HTTP_VERSION
| int cl_http::CpHttpRequestExecutor::HTTP_VERSION = 11 |
|
staticconstexprprivate |
◆ onResponseReceived_
◆ responseHandler_
| std::function<void(TResponse)> cl_http::CpHttpRequestExecutor::responseHandler_ |
|
private |
◆ sessionManager_
The documentation for this class was generated from the following files: