我想发送一个 GET 请求,只接受application/rdf+xml使用Accept:标头的类型结果。下面的代码对吗?
URLConnection connection = new URL(url + "?" + query).openConnection();
connection.setRequestProperty("Accept", "application/rdf+xml");
InputStream response = connection.getInputStream();