Initial commit: PrivateBin API C++ DLL implementation
This commit is contained in:
47
include/http_client.h
Normal file
47
include/http_client.h
Normal file
@ -0,0 +1,47 @@
|
||||
#ifndef HTTP_CLIENT_H
|
||||
#define HTTP_CLIENT_H
|
||||
|
||||
#include <string>
|
||||
|
||||
class HttpClient {
|
||||
public:
|
||||
/**
|
||||
* Performs an HTTP GET request
|
||||
*
|
||||
* @param url The URL to request
|
||||
* @param response Output parameter for the response
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
bool get(const std::string& url, std::string& response);
|
||||
|
||||
/**
|
||||
* Performs an HTTP POST request
|
||||
*
|
||||
* @param url The URL to request
|
||||
* @param data The data to send
|
||||
* @param response Output parameter for the response
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
bool post(const std::string& url, const std::string& data,
|
||||
std::string& response);
|
||||
|
||||
/**
|
||||
* Performs an HTTP DELETE request
|
||||
*
|
||||
* @param url The URL to request
|
||||
* @param data The data to send
|
||||
* @param response Output parameter for the response
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
bool delete_req(const std::string& url, const std::string& data,
|
||||
std::string& response);
|
||||
|
||||
private:
|
||||
#ifdef WINDOWS
|
||||
// Windows-specific implementation details
|
||||
#elif LINUX
|
||||
// Linux-specific implementation details
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // HTTP_CLIENT_H
|
||||
Reference in New Issue
Block a user