How do I return clean JSON from a WCF Service?

前端 未结 6 1120
借酒劲吻你
借酒劲吻你 2020-11-22 07:19

I am trying to return some JSON from a WCF service. This service simply returns some content from my database. I can get the data. However, I am concerned about the format

6条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 07:47

    When you are using GET Method the contract must be this.

    [WebGet(UriTemplate = "/", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
    List Get();
    

    with this we have a json without the boot parameter

    Aldo Flores @alduar http://alduar.blogspot.com

提交回复
热议问题