快速解决owin返回json字符串多带了双引号"多了重string转义字符串


解决方法:

 [HttpGet]
    public HttpResponseMessage getsystemtime()
    {
      cltime time = new cltime();
      time.datetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
      string relsut = JsonConvert.SerializeObject(time);
      var resp = new HttpResponseMessage { Content = new StringContent(relsut, System.Text.Encoding.UTF8, "application/json") };
      return resp;

    }

以上这篇快速解决owin返回json字符串多带了双引号"多了重string转义字符串就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持phpstudy。


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3