diff options
author | Eugene Sandulenko | 2019-10-24 17:30:25 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-10-24 17:41:28 +0200 |
commit | bbaebe594ea7a3b6afac4e40fbb367ed7b679e94 (patch) | |
tree | 6428c008230a69d7a1e89c1845eb205aba54bf04 /backends/networking/curl/postrequest.h | |
parent | 901118c5cd5b3fe2f0a80d1785e51a0f035663ab (diff) | |
download | scummvm-rg350-bbaebe594ea7a3b6afac4e40fbb367ed7b679e94.tar.gz scummvm-rg350-bbaebe594ea7a3b6afac4e40fbb367ed7b679e94.tar.bz2 scummvm-rg350-bbaebe594ea7a3b6afac4e40fbb367ed7b679e94.zip |
NETWORKING: Reworked PostRequest to a more universal API
Diffstat (limited to 'backends/networking/curl/postrequest.h')
-rw-r--r-- | backends/networking/curl/postrequest.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/backends/networking/curl/postrequest.h b/backends/networking/curl/postrequest.h index 568979473c..8992d3a1a3 100644 --- a/backends/networking/curl/postrequest.h +++ b/backends/networking/curl/postrequest.h @@ -37,15 +37,23 @@ class PostRequest: public Networking::Request { byte *_postData; int _postLen; + Common::JSONValue *_jsonData; + + Common::String _contentType; - void start(); void responseCallback(Networking::JsonResponse response); void errorCallback(Networking::ErrorResponse error); public: - PostRequest(Common::String url, byte *postData, int postLen, Networking::JSONValueCallback cb, Networking::ErrorCallback ecb); + PostRequest(Common::String url, Networking::JSONValueCallback cb, Networking::ErrorCallback ecb); virtual ~PostRequest(); + void start(); + + void setPostData(byte *postData, int postLen); + void setJSONData(Common::JSONValue *jsonData); + void setContentType(Common::String type) { _contentType = type; } + virtual void handle(); virtual void restart(); virtual Common::String date() const; |