相当于Python中Java的apache httpclient。下面是我们如何使用httpclient在Java中进行操作
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(GET_URL);
httpGet.addHeader("User-Agent", USER_AGENT);
CloseableHttpResponse httpResponse = httpClient.execute(httpGet)
;
答案 0 :(得分:0)
在“纯” python 2.7(我的意思是仅使用stdlib)中,它将是urllib2
,但事实上的标准现在是第三方python-requests
软件包。