mirror of
https://github.com/openappsec/openappsec.git
synced 2025-11-17 09:45:29 +03:00
sync code
This commit is contained in:
50
core/include/services_sdk/interfaces/i_http_client.h
Normal file
50
core/include/services_sdk/interfaces/i_http_client.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef __I_HTTP_CLIENT_H__
|
||||
#define __I_HTTP_CLIENT_H__
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "messaging/http_response.h"
|
||||
|
||||
class I_HttpClient
|
||||
{
|
||||
public:
|
||||
virtual ~I_HttpClient() = default;
|
||||
virtual void setProxy(const std::string& hosts) = 0;
|
||||
virtual void setBasicAuth(const std::string& username, const std::string& password) = 0;
|
||||
virtual void authEnabled(bool enabled) = 0;
|
||||
|
||||
virtual HTTPResponse
|
||||
get(
|
||||
const std::string& url,
|
||||
const std::map<std::string, std::string>& headers = {}
|
||||
) = 0;
|
||||
|
||||
virtual HTTPResponse
|
||||
post(
|
||||
const std::string& url,
|
||||
const std::string& data,
|
||||
const std::map<std::string, std::string>& headers = {}
|
||||
) = 0;
|
||||
|
||||
virtual HTTPResponse
|
||||
put(
|
||||
const std::string& url,
|
||||
const std::string& body,
|
||||
const std::map<std::string, std::string>& headers = {}
|
||||
) = 0;
|
||||
|
||||
virtual HTTPResponse
|
||||
patch(
|
||||
const std::string& url,
|
||||
const std::string& body,
|
||||
const std::map<std::string, std::string>& headers = {}
|
||||
) = 0;
|
||||
|
||||
virtual HTTPResponse
|
||||
del(
|
||||
const std::string& url,
|
||||
const std::map<std::string, std::string>& headers = {}
|
||||
) = 0;
|
||||
};
|
||||
|
||||
#endif // __I_HTTP_CLIENT_H__
|
||||
Reference in New Issue
Block a user