tags:

views:

91

answers:

1

I have checked the source codes of ASIHTTPRequest and could not make sure which one is.

Thanks

interdev

A: 

Try reading the documentation http://allseeing-i.com/ASIHTTPRequest/How-to-use

Look for "Reading response headers"

David Gelhar
Thanksthe the codesReading response headersASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];[request startSynchronous];NSString *poweredBy = [[request responseHeaders] objectForKey:@"X-Powered-By"];NSString *contentType = [[request responseHeaders] objectForKey:@"Content-Type"];are for Synchronous
Yes, the *example* is for synchronous, but that doesn't mean you can't use the `[request respsonseHeaders]` call in your `requestFinished:` delegate method.
David Gelhar
Thanks for reply. But I am confused. 'requestFinished:' is only triggered when a request finishied. If I want to get the size of a file before download, how can I do? Maybe I have misunderstand something.
Maybe you could do it in a downloadProgressDelegate (with showAccurateStatus=Yes). Once you start getting progress updates, presumably the headers have already been downloaded.
David Gelhar
Great,thanks a lot