java.io.IOException:服务器针对URL:https://aa09616289afe6a25ea1f7f6fbf12073:[email protected]/admin/api/2020-04/products.json返回了HTTP响应代码:406在sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)在sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)在sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)在java.net.URL.openStream(URL.java:1045)在javaapplication9.Send_HTTP_Request2.call_me(Send_HTTP_Request2.java:33)在javaapplication9.Send_HTTP_Request2.main(Send_HTTP_Request2.java:21)
myCodeURL url =新URL(“ https://aa09616289afe6a25ea1f7f6fbf12073:[email protected]/admin/api/2020-04/products.json”);
BufferedReader read = new BufferedReader(
new InputStreamReader(url.openStream()));
String i;
while ((i = read.readLine()) != null)
System.out.println(i);
read.close();
检查邮递员发布的所有标头是什么,还在Java代码中添加相同的标头(单击邮递员中的标头/代码链接以查看已解析的标头)