It also bit me. I used the GET request to check the reuse of the voucher code on the server. When we added a speed limit to redeem codes, some customers reported exceeding the limit before they appeared. It turns out that some of the checks caused two ransoms.
Your request uses the GET method.
The default behavior when using GET is to allow persistent connections ( Keep-Alive HTTP header ).
When using a persistent connection, your GET request may be retransmitted if something on the network looks out of date (this is a technical term), and not just a request failure. This is usually desirable because GET requests often have no side effects on the server.
POST or PUT requests, on the other hand, do not use a persistent connection by default and will not retransmit your transaction, which could very well be a credit card purchase or something else with significant side effects.
If you want your ASIHTTPRequest GET to sometimes send 2 or more requests to the server (due to network problems beyond your control), you can simply set this flag:
request.shouldAttemptPersistentConnection = NO;
This should take care of false GET duplicates on the server.
source share