http_interface.h
Go to the documentation of this file.
1 // Copyright 2022 Fraunhofer IPA
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include <json/json.h>
18 
21 
22 class CurlResource;
23 
25 {
26 public:
27  HTTPInterface(std::string host, std::string path = "");
28 
29  const std::map<std::string, std::string>
30  get(const std::vector<std::string>& json_keys, const std::string& command,
31  const std::initializer_list<param_type>& list = std::initializer_list<param_type>());
32 
33  const std::map<std::string, std::string> get(const std::vector<std::string>& json_keys, const std::string& command,
34  const param_map_type& params = param_map_type());
35 
36 private:
37  const std::map<std::string, std::string> get_(const std::vector<std::string>& json_keys, CurlResource& res);
38 
39  const std::string host;
40  const std::string base_path;
41 };
HTTPInterface::base_path
const std::string base_path
Definition: http_interface.h:40
HTTPInterface::get_
const std::map< std::string, std::string > get_(const std::vector< std::string > &json_keys, CurlResource &res)
Definition: http_interface.cpp:30
command
ROSLIB_DECL std::string command(const std::string &cmd)
HTTPInterface
Definition: http_interface.h:24
HTTPInterface::HTTPInterface
HTTPInterface(std::string host, std::string path="")
Definition: http_interface.cpp:5
param_map_type
std::map< std::string, std::string > param_map_type
Definition: param_map_type.h:20
HTTPInterface::get
const std::map< std::string, std::string > get(const std::vector< std::string > &json_keys, const std::string &command, const std::initializer_list< param_type > &list=std::initializer_list< param_type >())
Definition: http_interface.cpp:9
CurlResource
Definition: curl_resource.h:26
param_map_type.h
HTTPInterface::host
const std::string host
Definition: http_interface.h:39
param_type.h


pf_driver
Author(s): Harsh Deshpande
autogenerated on Sun Feb 4 2024 03:32:56