好吧,讓我說我想用POSTMAN或任何其他Rest服務客戶端工具來調用我的代碼,我該怎麼做呢?我的一個參數「數據」是巨大的,我不要想在URL中包含「數據」或有效載荷,我想從身體調用它?如何使用POSTMAN或任何客戶端工具應用程序調用RestFul WCF POST服務?
下面是實際的代碼
[OperationContract(Name = "createNewSurvey")]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "post/createNewSurvey")]
string CreateNewSurvey(string id, string Data);
public string CreateNewSurvey(string id, [FromBody]string Data)
{
//do somethoinf
return data;
}
任何幫助,將不勝感激它
感謝
爲什麼沒有郵遞員? –