C# API Return string instead of XML wrapped string

后端 未结 3 847
栀梦
栀梦 2021-01-28 03:18

I\'m using ApiController and I can\'t get the call to return anything other than XML.

public class GuideController : ApiController
{
    [AcceptVerbs(\"GET\")]

         


        
3条回答
  •  没有蜡笔的小新
    2021-01-28 03:32

    Try setting the Accept header in the client. If you want to receive JSON, set

    Accept: application/json

    in your client. Hope that helps.

提交回复
热议问题