Monitoring  3.3.4
O2 Monitoring library
HTTP.h
Go to the documentation of this file.
1 
6 #ifndef ALICEO2_MONITORING_TRANSPORTS_HTTP_H
7 #define ALICEO2_MONITORING_TRANSPORTS_HTTP_H
8 
9 #include "TransportInterface.h"
10 
11 #include <curl/curl.h>
12 #include <string>
13 
14 namespace o2
15 {
17 namespace monitoring
18 {
20 namespace transports
21 {
22 
26 class HTTP : public TransportInterface
27 {
28  public:
31  HTTP(const std::string& url);
32 
34  ~HTTP();
35 
38  void send(std::string&& post);
39 
41  void addHeader(const std::string& header);
42  private:
44  CURL *mCurl;
45 
47  struct curl_slist *mHeaders;
48 };
49 
50 } // namespace transports
51 } // namespace monitoring
52 } // namespace o2
53 
54 #endif // ALICEO2_MONITORING_TRANSPORTS_HTTP_H
Definition: Backend.h:23
void addHeader(const std::string &header)
Adds custom HTTP header.
Definition: HTTP.cxx:44
void send(std::string &&post)
Definition: HTTP.cxx:50
Transport interface for backends.
Definition: TransportInterface.h:31
~HTTP()
Destructor.
Definition: HTTP.cxx:37
HTTP POST transport.
Definition: HTTP.h:26
HTTP(const std::string &url)
Definition: HTTP.cxx:20