如何通过HttpURLConnection发送没有内容类型的get请求?

时间:2015-05-08 16:02:52

标签: java get httpurlconnection content-type

如何通过HttpURLConnection发送没有内容类型的get请求?这意味着,请求标头中没有内容类型。

我发现内容类型是 application / json 作为默认值(我没有调用

conn.setRequestProperty("Content-Type", contentType);

)。

但是,我希望get请求中有 no content-type

我使用代码获取HttpURLConnection的contentType:

System.out.println("contentType:" + conn.getContentType());

0 个答案:

没有答案