快捷搜索:  汽车  科技

postman接收的信息为什么是乱码?用postman调试文件上传接口

postman接收的信息为什么是乱码?用postman调试文件上传接口

postman一款API调试工具,如果没有用过的请略过,不过推荐大家使用。

postman接收的信息为什么是乱码?用postman调试文件上传接口(1)

postman上传文件接口测试,上传方式采用的是form-data模式。报错提示 Content type 'multipart/form-data;boundary=----WebKitFormBoundaryRAYPKeHKTYSNdzc1。

postman接收的信息为什么是乱码?用postman调试文件上传接口(2)

查看代码提示,是因为postman在提交数据的时候自动加入了content-type,content-type默认值为application/x-www-form-urlencoded,很明显不匹配 。

postman接收的信息为什么是乱码?用postman调试文件上传接口(3)

最后的处理方式把body旁边header里的content-type 整行删掉,重新提交没有报错了。

postman接收的信息为什么是乱码?用postman调试文件上传接口(4)

猜您喜欢: