aboutsummaryrefslogtreecommitdiff
path: root/ricochet/include
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-04-12 23:49:02 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-04-12 23:49:02 +0800
commit89267aed9047a5b23e0cb4b364bad90260913577 (patch)
tree420a7f6c4d675608f4ea0309967adfcbc45bceaf /ricochet/include
parentd97213f818761d298eec28cad42c4fbd242838f5 (diff)
downloadrcc-project-89267aed9047a5b23e0cb4b364bad90260913577.tar.gz
rcc-project-89267aed9047a5b23e0cb4b364bad90260913577.tar.xz
feat: implement HTTP POST support for form submissions and add input value persistence
Diffstat (limited to 'ricochet/include')
-rw-r--r--ricochet/include/ricochet/net/http_client.hh4
-rw-r--r--ricochet/include/ricochet/render/renderer.hh3
2 files changed, 6 insertions, 1 deletions
diff --git a/ricochet/include/ricochet/net/http_client.hh b/ricochet/include/ricochet/net/http_client.hh
index 2dd7419..45c92e8 100644
--- a/ricochet/include/ricochet/net/http_client.hh
+++ b/ricochet/include/ricochet/net/http_client.hh
@@ -51,7 +51,9 @@ public:
* @param url Target URL, for example "http://example.com"
* @return Returns HttpResponse on success, returns an error message string on failure
*/
- std::expected<HttpResponse, std::string> fetch( std::string_view url ) const;
+ std::expected<HttpResponse, std::string> fetch( std::string_view url,
+ std::string_view method = "GET",
+ std::string_view body = "" ) const;
private:
};
diff --git a/ricochet/include/ricochet/render/renderer.hh b/ricochet/include/ricochet/render/renderer.hh
index 8c49bbd..dda3ac5 100644
--- a/ricochet/include/ricochet/render/renderer.hh
+++ b/ricochet/include/ricochet/render/renderer.hh
@@ -19,6 +19,7 @@
#pragma once
#include "ricochet/parser/dom_tree.hh"
+#include <string>
namespace ricochet::render {
@@ -27,6 +28,8 @@ struct InputField
std::string name;
std::string action;
std::string method;
+ std::string value {};
+ std::string type {};
};
struct RenderResult
{