报错信息
(type=Not Acceptable, status=406)
这是因为没有设置请求头信息引起的
解决方法如下,(接口返回的是json)
conn.setRequestProperty("Accept","application/json");
报错信息
(type=Not Acceptable, status=406)
这是因为没有设置请求头信息引起的
解决方法如下,(接口返回的是json)
conn.setRequestProperty("Accept","application/json");
本文标题:Java HttpURLConnection 报406错误
本文链接:https://www.haomeiwen.com/subject/evupettx.html
网友评论