为流数据类型准备JSON数据请求

时间:2019-05-28 07:09:14

标签: c# json

如何为以下请求准备JSON数据:

尝试以下格式的json数据请求,但引发错误的请求错误:

{
    "filename":"test.txt",
    "fileContent": "eyJtZW51IjogewogICJpZCI6ICJmaWxlIiwKICAidmFsdW"
}
  

ServiceCall合同:

        [OperationContract]
        [WebInvoke(Method = "POST",
                   UriTemplate = "/fileuploader/upload",
                   BodyStyle = WebMessageBodyStyle.Bare,
                   RequestFormat = WebMessageFormat.Json,
                   ResponseFormat = WebMessageFormat.Json)]
 Stream LoadFile(string fileName, Stream fileContent);

0 个答案:

没有答案