waterlinkedsonar
C++ client library for the Water Linked Sonar 3D-15
Loading...
Searching...
No Matches
http_transport.hpp
Go to the documentation of this file.
1
3
4#ifndef WATERLINKEDSONAR_HTTP_TRANSPORT_HPP
5#define WATERLINKEDSONAR_HTTP_TRANSPORT_HPP
6
7#include <chrono>
8#include <optional>
9#include <string>
10
11namespace waterlinked::sonar {
12
18 public:
19 struct Response {
20 long status;
21 std::string body;
22 };
23
24 virtual ~HttpTransport() = default;
25
31 virtual Response get(const std::string& path) = 0;
32
42 virtual Response post(const std::string& path, const std::string& json_body,
43 std::optional<std::chrono::milliseconds>
44 timeout_override = std::nullopt) = 0;
45};
46
47} // namespace waterlinked::sonar
48
49#endif // WATERLINKEDSONAR_HTTP_TRANSPORT_HPP
Blocking HTTP transport.
Definition http_transport.hpp:17
virtual Response get(const std::string &path)=0
Issues a GET request to the given path.
virtual Response post(const std::string &path, const std::string &json_body, std::optional< std::chrono::milliseconds > timeout_override=std::nullopt)=0
Issues a POST request with a JSON body.
Definition client.hpp:14
Definition http_transport.hpp:19
std::string body
Definition http_transport.hpp:21
long status
Definition http_transport.hpp:20