轉載:[The Will Will Web] 如何讓 ASP.NET Web API 無論任何要求都回應 JSON 格式

// 須加入參考:「System.Net.Http.Formatting」、「System.Net.Http」.

        protected void Application_Start(object sender, EventArgs e)
        {            GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();  // 加入這一行.
        }

 

arrow
arrow
    文章標籤
    C# ASP.NET Web API JSON XML
    全站熱搜

    Robert 發表在 痞客邦 留言(0) 人氣()