Launch:
Callback method time:
1. After receiving the HTTP header, it is called when the data is actually claimed. Generally, some data storage objects such as NSMutableData are initialized in this method;
-(Void) connection :( NSURLConnection *) connection didReceiveResponse :( NSURLResponse *) response
2. This function is called every time a piece of data is received. Generally, data is added to the NSMutableData object.
-(Void) connection :( NSURLConnection *) connection didReceiveData :( NSData *) data
3. Call when receiving data fails and the download is interrupted
-(Void) connection :( NSURLConnection *) connection didFailWithError :( NSError *) error
4. Finally, if the connection is successful and downloaded, it will be called. Generally, some memory created by alloc will be released here.
-(Void) connectionDidFinishLoading :( NSURLConnection *) connection;
Progress tracking:
Each ASIHTTPRequest has two delegate entries to track the progress:
1: downLoadProgressDelegate (download) Example: [request setDownloadProgressDelegate: cell];
2: upLoadProgressDelgate (upload)
If you execute a single request, you need to set the upload/download progress for the request.
If you are making multiple requests and want to track the progress of the entire queue, you must use ASINetworkQueue and set the queue progress to delegate.