记录项目中遇到的case
现场: 当你的请求返回结果为json数据, get请求,使用浏览器访问时,出现类型转换失败的问题,但是使用postman访问时,可以成功显示数据结果
原因
查看浏览器的请求参数,与postman的请求参数,发现其中 headers中Accept 在浏览器接受的类型一般为
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
headers
而postman得Accept 请求格式为 * , 它将自动转换












网友评论