From 541707f9a8facf2140336d56cd634f331c540392 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 21 Feb 2024 12:05:16 +0100 Subject: [PATCH] lib/curl/Easy: add SetRequestBody() overload with std::span --- src/lib/curl/Easy.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/curl/Easy.hxx b/src/lib/curl/Easy.hxx index 52e9170d8..29bf63eba 100644 --- a/src/lib/curl/Easy.hxx +++ b/src/lib/curl/Easy.hxx @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -181,6 +182,10 @@ public: SetOption(CURLOPT_POSTFIELDSIZE, (long)size); } + void SetRequestBody(std::span s) { + SetRequestBody(s.data(), s.size()); + } + void SetRequestBody(std::string_view s) { SetRequestBody(s.data(), s.size()); }