When I review the code in ASIHTTPRequest ,I found following section
if (![[self requestMethod] isEqualToString:@"GET"]) {
[self setDownloadCache:nil];
}
But I don’t know why ? Who can tell me the reason?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In general GET requests are supposed to be free of side effects: all they do is produce a response (this is described in the http spec if I remember correctly). It is just perfectly safe to cache the response and use that to avoid making requests in the future.
On the other hand other http methods like post, put, delete do in general have side effects, so it’s not safe to just return a previous response: the caller may be relying in the side effect (for example a row being inserted into a database). In such a situation you wouldn’t just want to cache the “record created page” and display that from the cache instead of actually making the request.