【发布时间】:2009-03-17 11:16:53
【问题描述】:
我有一个 WCF 服务,它的方法看起来像这样(返回 null 以使用调试器进行测试,我现在只关心获取数据):
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "fares", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
public List<Fare> GetFares(Dictionary<int, int> itineraries, decimal? threshold, bool includeInternational)
{
return null;
}
我正在尝试使用 Fiddler 向该方法发出请求,但无法弄清楚正确的请求正文应该是什么。如果效果更好,我可以将 Dictionary 参数更改为其他参数。
在请求标头中我通过:
用户代理:提琴手
内容类型:应用程序/json;字符集=utf-8
我应该在身体里放什么?
【问题讨论】: