ReadAsAsync与ReadAsStringAsync之间的区别?

时间:2019-03-05 03:44:30

标签: c# asp.net json

我试图弄清楚这两种方法之间的区别, ReadAsAsync()和ReadAsStringAsync()

        public static string ContentAsString(this HttpResponseMessage response)
    {            
        var data = response.Content.ReadAsAsync<string>().Result;
        var data2 = response.Content.ReadAsStringAsync().Result;

        return data;
    }
  

数据返回“测试”

     

data2返回“ \” test \“”

为什么ReadAsStringAsync返回“ \ \”?

0 个答案:

没有答案