更新时间:2021-08-08 05:02:21
好像我找到了解决方案.我刚刚添加了第二种方法:
Looks like I have found solution. I just added second method:
[<OperationContract>]
[<WebInvoke(UriTemplate = "PostTest",
RequestFormat= WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json, Method = "POST")>]
abstract PostTest: obj: Test -> unit
[<OperationContract>]
[<WebInvoke(UriTemplate = "PostTest",
RequestFormat= WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json, Method = "OPTIONS")>]
abstract PostTestOptions: unit -> unit
只是空方法,什么也不做.我不知道原因,但是一切正常.
It is just empty methods that do nothing. I don't know the reason, but all is working.