C#Restful Service使用WebInvoke POST方法

时间:2013-09-20 12:54:13

标签: c# rest post webinvoke

我使用时服务运行良好:

[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "json/?id={id}")] 
string jdata(string id);

我的方法实施

public string json(string id)
{
    return "Your typed String is : " id;
}

到这里它运作良好, 但我必须在WebInvoke中使用Method=POST

[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "json/?id={id}")]
string jdata(string id);

当我使用它并致电服务时,我必须面对方法不允许。 请解决我的这个小问题......

0 个答案:

没有答案
相关问题