lib/curl/Easy: add method SetRequestBody(std::string_view)
This commit is contained in:
parent
b8210bbc45
commit
f086444e4a
@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <string_view>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An OO wrapper for a "CURL*" (a libCURL "easy" handle).
|
* An OO wrapper for a "CURL*" (a libCURL "easy" handle).
|
||||||
@ -167,6 +168,10 @@ public:
|
|||||||
SetOption(CURLOPT_POSTFIELDSIZE, (long)size);
|
SetOption(CURLOPT_POSTFIELDSIZE, (long)size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetRequestBody(std::string_view s) {
|
||||||
|
SetRequestBody(s.data(), s.size());
|
||||||
|
}
|
||||||
|
|
||||||
void SetMimePost(const curl_mime *mime) {
|
void SetMimePost(const curl_mime *mime) {
|
||||||
SetOption(CURLOPT_MIMEPOST, mime);
|
SetOption(CURLOPT_MIMEPOST, mime);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user