summaryrefslogtreecommitdiff
path: root/src/httpfetch.h
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-06-19 16:00:22 -0400
committerShadowNinja <shadowninja@minetest.net>2014-06-30 13:23:09 -0400
commitb2dfde8c8c29d0b118ba9018be202de21bb28505 (patch)
treea6add39e0e315c07625bc4b0625de8415683a43b /src/httpfetch.h
parent1c01ed5f13e15857a45921c51ef095ea5efda05d (diff)
downloadminetest-b2dfde8c8c29d0b118ba9018be202de21bb28505.tar.gz
minetest-b2dfde8c8c29d0b118ba9018be202de21bb28505.tar.bz2
minetest-b2dfde8c8c29d0b118ba9018be202de21bb28505.zip
Add support for multipart/form-data to HTTPFetch for server announcing
Diffstat (limited to 'src/httpfetch.h')
-rw-r--r--src/httpfetch.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/httpfetch.h b/src/httpfetch.h
index e02e92b4a..aba7482c2 100644
--- a/src/httpfetch.h
+++ b/src/httpfetch.h
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <string>
#include <vector>
+#include <map>
#include "config.h"
// Can be used in place of "caller" in asynchronous transfers to discard result
@@ -47,10 +48,16 @@ struct HTTPFetchRequest
// Timeout for the connection phase, in milliseconds
long connect_timeout;
- // POST data (should be application/x-www-form-urlencoded
- // unless a Content-Type header is specified in extra_headers)
+ // Indicates if this is multipart/form-data or
+ // application/x-www-form-urlencoded. POST-only.
+ bool multipart;
+
+ // POST fields. Fields are escaped properly.
// If this is empty a GET request is done instead.
- std::string post_fields;
+ std::map<std::string, std::string> post_fields;
+
+ // Raw POST data, overrides post_fields.
+ std::string post_data;
// If not empty, should contain entries such as "Accept: text/html"
std::vector<std::string> extra_headers;