QSMP.Web/Controllers/TestController.cs

(完整代码) 690B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web.Http;
using Newtonsoft.Json;
using QSMP.Utility.Format;


namespace QSMP.Web.Controllers
{
    public class TestController : ApiController
    {
        [HttpGet]
        public HttpResponseMessage GetProduct()
        {
            var product = new { id = 1, name = "三星王炸" };

            HttpResponseMessage result = new HttpResponseMessage();
            result.Content = new StringContent(product.ToJson(), Encoding.GetEncoding("UTF-8"), "application/json");
            return result;
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。