Qrypt Security
All Classes Namespaces Files Functions Variables Enumerations Enumerator
qryptsecurity_http.h
Go to the documentation of this file.
1 #ifndef QRYPTSECURITY_HTTP_H
2 #define QRYPTSECURITY_HTTP_H
3 
4 #include <string>
5 #include <vector>
6 
7 namespace QryptSecurity {
8 
12 struct HttpRequest {
16  std::string fqdn;
17 
21  std::string method;
22 
26  std::string path;
27 
31  std::vector<std::string> headers;
32 
36  std::string body;
37 
41  std::string caPath;
42 };
43 
47 struct HttpResponse {
51  int httpCode;
52 
56  std::string body;
57 };
58 
64 class HttpClient {
65 protected:
70 
74  virtual ~HttpClient() {}
75 
76 public:
77 
85  virtual HttpResponse send(const HttpRequest &httpRequest) = 0;
86 };
87 
88 } // namespace
89 
90 #endif
QryptSecurity::HttpResponse::httpCode
int httpCode
HTTP status code
Definition: qryptsecurity_http.h:51
QryptSecurity::HttpRequest::caPath
std::string caPath
CA path
Definition: qryptsecurity_http.h:41
QryptSecurity
Definition: qryptsecurity.h:9
QryptSecurity::HttpRequest::body
std::string body
The HTTP body
Definition: qryptsecurity_http.h:36
QryptSecurity::HttpRequest
HTTP request information
Definition: qryptsecurity_http.h:12
QryptSecurity::HttpClient::~HttpClient
virtual ~HttpClient()
Custom destructor
Definition: qryptsecurity_http.h:74
QryptSecurity::HttpRequest::path
std::string path
The HTTP path or route
Definition: qryptsecurity_http.h:26
QryptSecurity::HttpRequest::fqdn
std::string fqdn
The Fully Qualified Domain Name (FQDN) with prepended protocol
Definition: qryptsecurity_http.h:16
QryptSecurity::HttpClient::send
virtual HttpResponse send(const HttpRequest &httpRequest)=0
Sends an HTTP request using a given configuration object. HttpClientError must be raised for any erro...
QryptSecurity::HttpClient::HttpClient
HttpClient()
Custom constructor
Definition: qryptsecurity_http.h:69
QryptSecurity::HttpResponse
HTTP response information
Definition: qryptsecurity_http.h:47
QryptSecurity::HttpRequest::method
std::string method
The HTTP method to use (ex. "GET" or "POST")
Definition: qryptsecurity_http.h:21
QryptSecurity::HttpRequest::headers
std::vector< std::string > headers
The HTTP list of headers
Definition: qryptsecurity_http.h:31
QryptSecurity::HttpResponse::body
std::string body
Response body, as a string
Definition: qryptsecurity_http.h:56
QryptSecurity::HttpClient
Abstract base class for HTTP clients.
Definition: qryptsecurity_http.h:64