开发者

HttpClient POST gets html page about 2.5x slower than browser

开发者 https://www.devze.com 2023-01-18 18:19 出处:网络
When I hit Search on London journey planner (e.g from Holborn to Savoy Pier), I get result in about 4 secs. When I do that with HttpClient using POST method, this line takes about 10 secs:

When I hit Search on London journey planner (e.g from Holborn to Savoy Pier), I get result in about 4 secs. When I do that with HttpClient using POST method, this line takes about 10 secs:

I开发者_JAVA技巧nputStream is = httpClient.execute(httpPost).getEntity().getContent();

Any ideas what can be the problem? I'm sending the same parameters as browser and I have also set User-Agent to Chrome.


Difficult to say, what is your problem, without seeing the code that performs the test and the measurement.

One suggestion, for troubleshooting with HttpClient: use logging.

And, to remove human errors from this comparison, it would be advisable to use some command-line tool (e.g. wget) instead of the browser to perform the comparative POST.

0

精彩评论

暂无评论...
验证码 换一张
取 消