Arronlong / httpclientutil

该项目基于HttpClient-4.4.1封装的一个工具类。提供了更为简单的GET、POST及上传下载等功能。同时支持插件式配置Http-Header(包含自定义header)、配置SSL和Proxy等。
https://blog.csdn.net/xiaoxian8023/category_9264781.html
Apache License 2.0
1.41k stars 719 forks source link

发送POST请求携带中文参数 #50

Closed FangPengbo closed 2 years ago

FangPengbo commented 4 years ago

发送POST请求携带中文参数会报400错误. 接口接受的是String类型

请求地址: https://xxxxx/hystrix/user 请求方式: POST JSON串: { "name":"aaa", "age":180 } 响应结果: {"name":"aaa","age":180}

请求地址: https://xxxxx/hystrix/user 请求方式: POST JSON串: { "name":"测试", "age":180 } 响应结果: {"timestamp":"2020-08-04T04:31:52.593+0000","path":"/hystrix/user","status":400,"error":"Bad Request","message":"Failed to read HTTP message"}