remove HttpMethod enum

This commit is contained in:
MihailRis 2026-09-09 23:47:23 +03:00
parent 74bb695807
commit 018e4c9f2c
2 changed files with 2 additions and 18 deletions

View file

@ -63,19 +63,7 @@ public:
buffer.clear(); buffer.clear();
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
switch (request.method) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, request.method);
case HttpMethod::GET:
break;
case HttpMethod::POST:
curl_easy_setopt(curl, CURLOPT_POST, true);
break;
case HttpMethod::PUT:
curl_easy_setopt(curl, CURLOPT_UPLOAD, true);
break;
case HttpMethod::DELETE:
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
break;
}
curl_slist* hs = nullptr; curl_slist* hs = nullptr;

View file

@ -10,10 +10,6 @@
#include <mutex> #include <mutex>
namespace network { namespace network {
enum class HttpMethod {
GET, POST, PUT, DELETE,
};
using OnResponse = std::function<void(std::vector<char>)>; using OnResponse = std::function<void(std::vector<char>)>;
using OnReject = std::function<void(int, std::vector<char>)>; using OnReject = std::function<void(int, std::vector<char>)>;
using ConnectCallback = std::function<void(u64id_t, u64id_t)>; using ConnectCallback = std::function<void(u64id_t, u64id_t)>;
@ -22,7 +18,7 @@ namespace network {
using ClientDatagramCallback = std::function<void(u64id_t cid, const char* buffer, size_t length)>; using ClientDatagramCallback = std::function<void(u64id_t cid, const char* buffer, size_t length)>;
struct HttpRequest { struct HttpRequest {
HttpMethod method; std::string method;
std::string url; std::string url;
std::string body; std::string body;
std::vector<std::string> headers; std::vector<std::string> headers;