【发布时间】:2020-05-02 01:58:46
【问题描述】:
我有一个 WCf 休息服务,它有两个输入参数:字符串和流:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "ImportStream/{Separator}", ResponseFormat =
WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
void ImportStream(string Separator, stream data);
我的代码:
public void ImportStream (string Separator, Stream inputpar)
{ //...
}
我的目标是使用 POSTMAN 调用服务: https://localhost:44355/ServiceLias.svc/rest/ImportStream/Comma
在正文中,我将 Stream 写为 Text ,
但我从一开始就有错误:
For request in operation ImportStream to be a stream the operation must have a single parameter whose type is Stream.
我该如何解决?或者有什么想法可以实现我的目标?谢谢,
【问题讨论】:
-
这能回答你的问题吗? WCF Rest Webservice with stream