Today, a wonderful problem is described as follows:
The client initiates one time to the server (it can be seen from the log that only one log is printed), but there are repeated requests for data on the backend at the back end. This problem is not easy to appear, and in Chinese search is not the corresponding results;
A solution to the problem is found today in a foreign site:
The reasons are as follows: Due to the time-out of the link and fetch data, after the client sends the data, it detects that it may not be sent successfully to the backend, this time the HTTP underlying will automatically resend the request (note that the HTTP underlying, so the application will not know that many requests were sent). If the application side automatically re-sends multiple requests, the backend also responds to multiple requests, but the previous paragraph only replies 1 requests. So in order to solve this problem, as long as the defaulthttpclient set the following code can be resolved:
defaultHttpClient.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(0, false));
Android or Java solution for sending HTTP automatic resend requests