How to remove d: and __type from JSON response for ASP web service

前端 未结 3 914
别跟我提以往
别跟我提以往 2021-01-03 02:05

I\'ve found several solutions for this on the web that are for WCF web service and not ASP web service.

Currently, I\'m getting back a JSON response that says:

3条回答
  •  悲&欢浪女
    2021-01-03 02:32

    If you're using ServiceStack.Text JSON Serializer you just need to:

    JsConfig.ExcludeTypeInfo = true;
    

    This functionality was automatically added back in v2.28, but the code above keeps that out of the serialization. You can also change this behavior by Type with:

    JsConfig.ExcludeTypeInfo = true;
    

提交回复
热议问题