mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 17:28:29 +00:00
keepalive: support multiple post using content provider (#461)
This commit is contained in:
parent
31bb13abd2
commit
d043b18097
2 changed files with 18 additions and 2 deletions
15
httplib.h
15
httplib.h
|
@ -855,6 +855,21 @@ inline void Post(std::vector<Request> &requests, const char *path,
|
|||
Post(requests, path, Headers(), body, content_type);
|
||||
}
|
||||
|
||||
inline void Post(std::vector<Request> &requests,
|
||||
const char *path, size_t content_length,
|
||||
ContentProvider content_provider, const char *content_type) {
|
||||
Request req;
|
||||
req.method = "POST";
|
||||
req.headers = Headers();
|
||||
req.path = path;
|
||||
req.content_length = content_length;
|
||||
req.content_provider = content_provider;
|
||||
|
||||
if (content_type) { req.headers.emplace("Content-Type", content_type); }
|
||||
|
||||
requests.emplace_back(std::move(req));
|
||||
}
|
||||
|
||||
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||
class SSLServer : public Server {
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue