【发布时间】:2015-03-02 19:28:16
【问题描述】:
[OperationContract]
[WebInvoke(UriTemplate = "s={s}", Method = "POST")]
string EchoWithPost(string s);
我正在尝试使用WebRequest 使用此方法(WCF 服务):
WebRequest request1 = WebRequest.Create("http://MyIP/Host");
request1.Method = "POST";
request1.ContentType = "application/x-www-form-urlencoded";
string postData1 = "s=TestString";
我不想在 url 中传递数据 (s=TestString),我想做的是在消息正文中传递数据。
【问题讨论】: