|
@@ -32,6 +32,17 @@ static bool ExtractDataFromDebranchResponse(const std::string& content, T& outDa
|
|
|
return (!GetJsonRootObject(rawRoot, content)) ? false : Json2Object(outDataStruct, rawRoot["data"]);
|
|
|
}
|
|
|
|
|
|
+template <typename T>
|
|
|
+static bool FulfillRequestJsonBody(HttpClientRequestConfig* pConfig, const T& dataStruct)
|
|
|
+{
|
|
|
+ std::string jsonValue;
|
|
|
+ if (Object2Json(jsonValue, dataStruct)) {
|
|
|
+ pConfig.SetJsonBody(jsonValue);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
} //Restful
|
|
|
|
|
|
} //Module
|