【问题标题】:Problem with POST request to RESTful WCF Service对 RESTful WCF 服务的 POST 请求出现问题
【发布时间】:2009-07-18 03:44:08
【问题描述】:

我正在尝试向我的宁静 WCF 服务发出发布请求。合同是这样的:

    [OperationContract]
    [WebInvoke(Method = "POST",
                 RequestFormat = WebMessageFormat.Json,
                 ResponseFormat=WebMessageFormat.Json,
               BodyStyle = WebMessageBodyStyle.Wrapped,
               UriTemplate = "UploadMovie")]
    string UploadMovie(Stream stream);

    [OperationContract]
    [WebInvoke(Method = "POST",
                 RequestFormat = WebMessageFormat.Json,
                 ResponseFormat=WebMessageFormat.Json,
               BodyStyle = WebMessageBodyStyle.Wrapped,
               UriTemplate = "UploadMovie")]
    string UploadMovie(byte [] stream);

我正在尝试使用Fiddler 提出请求,但我无法通过在请求中添加一些正文来使其工作。身体需要是什么样的?我一直在体内写正确的Json,但还是不行……

谢谢

【问题讨论】:

  • 您收到错误消息了吗?
  • 我正在做一些类似于 {"stream" : data} 的事情

标签: c# wcf post


【解决方案1】:

我的问题是我没有在帖子标题中设置内容类型

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-30
    • 1970-01-01
    • 1970-01-01
    • 2013-01-15
    • 1970-01-01
    • 1970-01-01
    • 2011-01-21
    • 1970-01-01
    相关资源
    最近更新 更多