src/HTTPClient.h
branchv_0
changeset 9 9fdbfbe24161
parent 6 59c9ca066322
child 11 6b913e82f52a
equal deleted inserted replaced
8:3f4e60990393 9:9fdbfbe24161
    16  */
    16  */
    17 #pragma once
    17 #pragma once
    18 
    18 
    19 #include <string>
    19 #include <string>
    20 #include <vector>
    20 #include <vector>
       
    21 #include <stdexcept>
    21 
    22 
    22 #include <relpipe/common/type/typedefs.h>
    23 #include <relpipe/common/type/typedefs.h>
    23 
    24 
    24 
    25 
    25 namespace relpipe {
    26 namespace relpipe {
    64 		int responseCode = 0;
    65 		int responseCode = 0;
    65 		std::vector<std::string> headers;
    66 		std::vector<std::string> headers;
    66 		std::string body;
    67 		std::string body;
    67 	};
    68 	};
    68 
    69 
       
    70 	class Exception : public std::runtime_error {
       
    71 	public:
       
    72 
       
    73 		Exception(const std::string& message) : runtime_error(message) {
       
    74 		}
       
    75 
       
    76 		Exception(const char* message) : runtime_error(message) {
       
    77 		}
       
    78 
       
    79 	};
       
    80 
    69 	virtual ~HTTPClient();
    81 	virtual ~HTTPClient();
    70 	HTTPClient(const HTTPClient&) = delete;
    82 	HTTPClient(const HTTPClient&) = delete;
    71 	HTTPClient& operator=(const HTTPClient&) = delete;
    83 	HTTPClient& operator=(const HTTPClient&) = delete;
    72 
    84 
    73 	static HTTPClient* open();
    85 	static HTTPClient* open();