为何c#的httpclient post一串json到tornado端,json.loads无法完成序列化?


print出来的self.request.body是b'q=123&qw=123',这在python上一般是b'{'q':'123'}能够loads成功,c#post的数据却是b'q=123&qw=123,我应该怎么做?以下是c#用httpclient post的代码

        HttpClient client = new HttpClient();

            var content = new FormUrlEncodedContent(new Dictionary<string, string>()
           {
               {"q", "123"},
                {"qw", "123"},

           });
            var response = await client.PostAsync("http://localhost:8888/gen",content);
            string a = await response.Content.ReadAsStringAsync();
            return a;
  • 目前还没有回复
添加一条新回复
登录 或者 注册 后发表回复