C# noob here.
I'm doing a simple wcf service RestAPI, so far so good...but my json string response isn't coming out the way i wanted.
Actual response: {"GetInfoResult":{"Name": "John"}}
Desired response: {"Name": "John"}
how do I remove GetInfoResult field?
Thanks
你应该能够只需设置BodyStyle到WebMessageBodyStyle.Bare
您WebGet
注释,默认为WebMessageBodyStyle.Wrapped
,增加了不希望的包装;
[WebGet(BodyStyle = WebMessageBodyStyle.Bare)]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.