mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
remove HttpMethod enum
This commit is contained in:
parent
74bb695807
commit
018e4c9f2c
2 changed files with 2 additions and 18 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@
|
|||
#include <mutex>
|
||||
|
||||
namespace network {
|
||||
enum class HttpMethod {
|
||||
GET, POST, PUT, DELETE,
|
||||
};
|
||||
|
||||
using OnResponse = std::function<void(std::vector<char>)>;
|
||||
using OnReject = std::function<void(int, std::vector<char>)>;
|
||||
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)>;
|
||||
|
||||
struct HttpRequest {
|
||||
HttpMethod method;
|
||||
std::string method;
|
||||
std::string url;
|
||||
std::string body;
|
||||
std::vector<std::string> headers;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue