lib/curl/Easy: add SetRequestBody() overload with std::span
This commit is contained in:
parent
00cf036d58
commit
541707f9a8
@ -9,6 +9,7 @@
|
|||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <span>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@ -181,6 +182,10 @@ public:
|
|||||||
SetOption(CURLOPT_POSTFIELDSIZE, (long)size);
|
SetOption(CURLOPT_POSTFIELDSIZE, (long)size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetRequestBody(std::span<const std::byte> s) {
|
||||||
|
SetRequestBody(s.data(), s.size());
|
||||||
|
}
|
||||||
|
|
||||||
void SetRequestBody(std::string_view s) {
|
void SetRequestBody(std::string_view s) {
|
||||||
SetRequestBody(s.data(), s.size());
|
SetRequestBody(s.data(), s.size());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user