post iis Express 中不允许的方法
post method not allowed in iis Express
我正在尝试学习使用 WCF 开发 Web 服务。
我想在此示例中使用 post 方法,因为我已经实现了 Get
方法。代码是:
[OperationContract]
[WebInvoke(Method = "POST",
RequestFormat= WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "Json/{id}")]
public void JsonData(string id)
{
return "id is :" + id;
}
当我在 get 的位置使用 post 方法但它在 get 方法中工作时,这是不允许的显示方法。
请帮帮我。
如果您有 Fiddler,您需要转到 Composer
选项卡,选择 POST
的方法,输入您的 URL,然后点击 Execute
:
我正在尝试学习使用 WCF 开发 Web 服务。
我想在此示例中使用 post 方法,因为我已经实现了 Get
方法。代码是:
[OperationContract]
[WebInvoke(Method = "POST",
RequestFormat= WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "Json/{id}")]
public void JsonData(string id)
{
return "id is :" + id;
}
当我在 get 的位置使用 post 方法但它在 get 方法中工作时,这是不允许的显示方法。
请帮帮我。
如果您有 Fiddler,您需要转到 Composer
选项卡,选择 POST
的方法,输入您的 URL,然后点击 Execute
: