mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2024-10-28 11:19:36 +01:00
Bump cpp-httplib to v0.14.1
This commit is contained in:
parent
77dedd06db
commit
d51d440539
2 changed files with 4612 additions and 2422 deletions
7017
src/net/httplib.h
7017
src/net/httplib.h
File diff suppressed because it is too large
Load diff
|
@ -145,10 +145,10 @@ HTTPResponse HTTPRequest::get() {
|
|||
ret._headers.emplace(h.first, h.second);
|
||||
}
|
||||
else {
|
||||
int err = result.error();
|
||||
const char *errname = httpErrorNames[err];
|
||||
auto err = result.error();
|
||||
std::string errname = httplib::to_string(err);
|
||||
delete client;
|
||||
throw Exception(Exception::MKXPError, "Failed to GET %s (%i: %s)", destination.c_str(), err, errname);
|
||||
throw Exception(Exception::MKXPError, "Failed to GET %s (%i: %s)", destination.c_str(), err, errname.c_str());
|
||||
}
|
||||
|
||||
delete client;
|
||||
|
@ -192,10 +192,10 @@ HTTPResponse HTTPRequest::post(StringMap &postData) {
|
|||
ret._headers.emplace(h.first, h.second);
|
||||
}
|
||||
else {
|
||||
int err = result.error();
|
||||
const char *errname = httpErrorNames[err];
|
||||
auto err = result.error();
|
||||
std::string errname = httplib::to_string(err);
|
||||
delete client;
|
||||
throw Exception(Exception::MKXPError, "Failed to POST %s (%i: %s)", destination.c_str(), err, errname);
|
||||
throw Exception(Exception::MKXPError, "Failed to POST %s (%i: %s)", destination.c_str(), err, errname.c_str());
|
||||
}
|
||||
delete client;
|
||||
return ret;
|
||||
|
@ -234,9 +234,10 @@ HTTPResponse HTTPRequest::post(const char *body, const char *content_type) {
|
|||
ret._headers.emplace(h.first, h.second);
|
||||
}
|
||||
else {
|
||||
int err = result.error();
|
||||
auto err = result.error();
|
||||
std::string errname = httplib::to_string(err);
|
||||
delete client;
|
||||
throw Exception(Exception::MKXPError, "Failed to POST %s (%i: %s)", destination.c_str(), err, httpErrorNames[err]);
|
||||
throw Exception(Exception::MKXPError, "Failed to POST %s (%i: %s)", destination.c_str(), err, errname.c_str());
|
||||
}
|
||||
delete client;
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue