Allright, I solved this myself with some more investigation. All I had to do was to add a parameter that sets the HTTP Version to 1.1, as follows:
HttpParams params = new BasicHttpParams();
params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
HttpClient httpclient = new DefaultHttpClient(params);
I found this thanks to the very nice HttpHelper Class from and-bookworm and some trial-and-error.
If I remember correctly, HTTP 1.0 opens a new TCP connection for every request. Does that explain the large delay?
A HTTP POST request now takes between 50 and 150 ms over WLAN and something between 300 and 500 ms over 3G.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…