use*_*595 1 c# wcf web-services soapui restful-url
好吧,我想说我想使用POSTMAN或任何其他Rest服务客户端工具来调用我的代码,我该怎么办呢?我的一个参数"数据"是巨大的,我不想要包含URL中的"数据"或有效负载,我想从身体调用它?
这是实际的代码
[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;
}
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激
谢谢
小智 6
在邮递员中,您必须在"输入请求URL"框中编写此字符串http://localhost/Sample/Service1.svc/createNewSurvey并选择POST,在标题中添加以下两个键:
并在正文中选择"原始"单选按钮并写入: