Rest 服务方法=";删除";。方法不允许

Rest 服务方法=";删除";。方法不允许,rest,wcf,Rest,Wcf,我的方法的合同如下: [OperationContract] [WebInvoke(Method = "DELETE", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/myMethod/{param}/", BodyStyle = WebMessageBody

我的方法的合同如下:

[OperationContract]
[WebInvoke(Method = "DELETE", 
           RequestFormat = WebMessageFormat.Json, 
           ResponseFormat = WebMessageFormat.Json, 
           UriTemplate = "/myMethod/{param}/", 
           BodyStyle = WebMessageBodyStyle.Bare)]
void myMethod(string param);
我用小提琴来测试它

http://localhost:1234/MyService.svc/jsonMS/myMethod/1/

我收到错误“Method not allowed.”。

如果在Fiddler中测试此方法,则需要确保:

  • 向您的URL发送JSON请求
  • 调用此方法时,请使用HTTP
    DELETE
    方法(而不是
    GET

@marc_s我通过web.config配置它,它是一个端点。@marc_s就是这样,我没有以正确的方式在Fiddler中进行测试。我过去常去。你能回答我的问题吗?这样我就可以选择你最好的答案了。马克,你是怎么做到的?