diff --git a/src/network/Curl.cpp b/src/network/Curl.cpp index 4aad9c612..6e89418c9 100644 --- a/src/network/Curl.cpp +++ b/src/network/Curl.cpp @@ -63,19 +63,7 @@ public: buffer.clear(); curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); - switch (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_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, request.method); curl_slist* hs = nullptr; diff --git a/src/network/commons.hpp b/src/network/commons.hpp index 893a88ebe..614821404 100644 --- a/src/network/commons.hpp +++ b/src/network/commons.hpp @@ -10,10 +10,6 @@ #include namespace network { - enum class HttpMethod { - GET, POST, PUT, DELETE, - }; - using OnResponse = std::function)>; using OnReject = std::function)>; using ConnectCallback = std::function; @@ -22,7 +18,7 @@ namespace network { using ClientDatagramCallback = std::function; struct HttpRequest { - HttpMethod method; + std::string method; std::string url; std::string body; std::vector headers;