From 4ee7025ab09b606a2556bf9f42c1218d7fd72843 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Fri, 17 Jun 2022 02:46:55 -0400 Subject: add file upload via dnd + rework http --- src/http.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/http.hpp') diff --git a/src/http.hpp b/src/http.hpp index 0c570db..a6f479d 100644 --- a/src/http.hpp +++ b/src/http.hpp @@ -1,9 +1,9 @@ #pragma once #include +#include #include #include - -// i regret not using snake case for everything oh well +#include namespace http { enum EStatusCode : int { @@ -115,7 +115,7 @@ struct request { void set_body(const std::string &data); void set_user_agent(const std::string &data); void make_form(); - void add_file(std::string_view name, std::string_view file_path, std::string_view filename); + void add_file(std::string_view name, const Glib::RefPtr &file, std::string_view filename); void add_field(std::string_view name, const char *data, size_t size); response execute(); @@ -129,6 +129,8 @@ private: curl_slist *m_header_list = nullptr; std::array m_error_buf = { 0 }; curl_mime *m_form = nullptr; + + std::set> m_read_streams; }; using response_type = response; -- cgit v1.2.3