|
@@ -88,15 +88,15 @@ struct HttpClientRequestConfig
|
|
|
* @return :
|
|
|
*/
|
|
|
HttpClientRequestConfig(const std::string& uri)
|
|
|
- :mMethod(HttpRequestMethod::GET), mUri(uri), mToValidCert(false)
|
|
|
+ :mMethod(HttpRequestMethod::GET), mUri(uri), mToValidCert(false), mBodyContent(""), mTimeoutSecs(0)
|
|
|
{
|
|
|
}
|
|
|
HttpClientRequestConfig(HttpRequestMethod method)
|
|
|
- : mMethod(method), mToValidCert(false)
|
|
|
+ : mMethod(method), mToValidCert(false), mBodyContent(""), mTimeoutSecs(0)
|
|
|
{
|
|
|
}
|
|
|
HttpClientRequestConfig(HttpRequestMethod method, const std::string& uri)
|
|
|
- :mMethod(method), mUri(uri), mToValidCert(false)
|
|
|
+ :mMethod(method), mUri(uri), mToValidCert(false), mBodyContent(""), mTimeoutSecs(0)
|
|
|
{
|
|
|
}
|
|
|
|
|
@@ -118,15 +118,29 @@ struct HttpClientRequestConfig
|
|
|
|
|
|
bool NeedValidCert() const { return mToValidCert; }
|
|
|
|
|
|
+ void SetJsonBody(const std::string& value) { mBodyContent = value; }
|
|
|
+ virtual std::string GetJsonBody() const { return mBodyContent; }
|
|
|
+
|
|
|
+ void SetTimeout(uint32_t timeoutSecs) { mTimeoutSecs = timeoutSecs; }
|
|
|
+ uint32_t GetTimeout() const { return mTimeoutSecs; }
|
|
|
+
|
|
|
private:
|
|
|
|
|
|
HttpRequestMethod mMethod;
|
|
|
std::string mUri;
|
|
|
std::string mSubUri;
|
|
|
+ std::string mBodyContent;
|
|
|
|
|
|
std::map<std::string, std::string> mQueryPairs;
|
|
|
|
|
|
bool mToValidCert;
|
|
|
+ uint32_t mTimeoutSecs;
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+struct HttpClientPostTypeRequest : public HttpClientRequestConfig
|
|
|
+{
|
|
|
+ HttpClientPostTypeRequest(const std::string& uri) :HttpClientRequestConfig(HttpRequestMethod::POST, uri) {}
|
|
|
};
|
|
|
|
|
|
struct HttpClientResponseResult
|