我正在构建一个简单的休息客户端来调用其余的Web服务。 现在,我想调用Post rest Web服务,我希望将这个结构放入体内:
<component>
<section>
Etc.
</section>
</component>
所以我有这段代码,但是我无法将这些结构数据放入正文部分。
public void writeSectionIntoCCD(String appID, String shardSecret, String userID, String password, String templateID)
{
String currentTime = DateTime.Now.ToString("yyyyMMdd");
String URL = "https://sitoweb.it/APPName/";
var client = new RestClient(URL);
// client.Authenticator = new HttpBasicAuthenticator(username, password);
string hash = CalculateMD5Hash(currentTime + shardSecret + password);
var request = new RestRequest("resource/ccd/" + userID + "/" + appID + "/" + currentTime + "/" + hash + "/replace_section?" + templateID, Method.POST);
var body = "<component><section>Etc.</section></component>";
IRestResponse response = client.Execute(request);
}