相关疑难解决方法(0)

使用WCF支持"application/x-www-form-urlencoded"发布数据的最佳方式?

我正在构建基于W3C规范的WCF服务,该规范定义了一个接受"application/x-www-form-urlencoded"发布数据的RESTful Web服务端点.默认情况下,WCF不支持这种类型的消息编码,我发现了许多创建合同的不同示例,如下所示:

XElement Query_Post(Stream postData);
Run Code Online (Sandbox Code Playgroud)

然后在实现中postData使用该HttpUtility.ParseQueryString方法解码流.

有没有人知道在WCF中支持"application/x-www-form-urlencoded"的更强类型的方式?

我希望我的运营合同是:

XElement Query_Post(string query, string [] params);
Run Code Online (Sandbox Code Playgroud)

rest wcf post web-services http

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

http ×1

post ×1

rest ×1

wcf ×1

web-services ×1