从后台下载Excel数据 前端代码
<form action='http://127.0.0.1:8080/download' method='POST' id='form1' enctype="application/x-www-form-urlencoded;charset=UTF-8">
<input type='hidden' value='京东云' name='searchData' id='id'/>
<input type="submit" value="submit">
</form>
后端日志发现请求参数是乱码
但是使用CURL 就能正确的识别
curl -o download.xls 'http://localhost:8080/download' -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' -d 'searchData=京东云'
为什么form表单不行 而curl可以呢? 不都指定了Content-Type: application/x-www-form-urlencoded;charset=UTF-8
了吗?
http://www.w3school.com.cn/ta...
没见过在enctype 中设置字符集的。