如何为以下请求准备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);