无法读取Json字符串

时间:2015-06-12 05:57:10

标签: c# json

当我读取Json字符串时,我得到了一些垃圾值。像这样的东西

result = "�\b\0\0\0\0\0\0�TMo�0\f�+�vu0�@[��\n�N�f@;�vIrPl� Y�>�z���([N�9�a��\"����(/^����R%��\fM/tV\0�4��q5�9�h�|��66��PY���\f������Yf��L4+-��럍F����}�*z��X�Ȣe@�(p5�x�E4sk�-��u��LK��S%7�B0M*'D�4u鱵�/K�+�tB>�M���肔���CB� /��<i((V%Kzu��]!儛�...  

我怎么读这个?以下是我的功能:

static async Task RunAsync()
{

    using (var client = new HttpClient(new HttpClientHandler() {UseDefaultCredentials = true}))
    {
        client.BaseAddress = new Uri("http://localhost:8081/");

        client.DefaultRequestHeaders.Accept.Clear();
        client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        HttpResponseMessage response = await client.GetAsync("api/MyDataAPi/CustomerView/3/-1/1/ORDER%20BY%20CreatedDate%20DESC/");
        var result1 = response.Content.ReadAsStringAsync().Result;
        if (response.IsSuccessStatusCode)
        {
            var result1 = response.Content.ReadAsStringAsync().Result;
            // what I get is result1 is this .. How Do I read this.. unable to understand the problem
            result = "�\b\0\0\0\0\0\0�TMo�0\f�+�vu0�@[��\n�N�f@;�vIrPl� Y�>�z���([N�9�a��\"����(/^����R%��\fM/tV\0�4��q5�9�h�|
        ��66��PY���\f������Yf��L4+-��럍F����}�*z��X�Ȣe@�(p5�x�E4sk�-��u��LK��S%7�B0M*'D�4u鱵�/K�+�tB>�M���肔���CB� /��<i
        ((V%Kzu��]!儛�...";
         }
         else
         {  

         }
     }
 }

0 个答案:

没有答案