// When YES, requests will automatically redirect when they get a HTTP 30x header (defaults to YES)
BOOLshouldRedirect;
// Used internally to tell the main loop we need to stop and retry with a new url
BOOLneedsRedirect;
// Incremented every time this request redirects. When it reaches 5, we give up
intredirectCount;
// When NO, requests will not check the secure certificate is valid (use for self-signed cerficates during development, DO NOT USE IN PRODUCTION) Default is YES
// Reads the response headers to find the content length, and returns true if the request needs a username and password (or if those supplied were incorrect)
// Reads the response headers to find the content length, encoding, cookies for the session
// Also initiates request redirection when shouldRedirect is true
// Returns true if the request needs a username and password (or if those supplied were incorrect)
ASIRequestCancelledError=[[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASIRequestCancelledErrorTypeuserInfo:[NSDictionarydictionaryWithObjectsAndKeys:@"The request was cancelled",NSLocalizedDescriptionKey,nil]]retain];
ASIUnableToCreateRequestError=[[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASIUnableToCreateRequestErrorTypeuserInfo:[NSDictionarydictionaryWithObjectsAndKeys:@"Unable to create request (bad url?)",NSLocalizedDescriptionKey,nil]]retain];
ASITooMuchRedirectionError=[[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASITooMuchRedirectionErrorTypeuserInfo:[NSDictionarydictionaryWithObjectsAndKeys:@"The request failed because it redirected too many times",NSLocalizedDescriptionKey,nil]]retain];
[selffailWithError:[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASIInternalErrorWhileBuildingRequestTypeuserInfo:[NSDictionarydictionaryWithObjectsAndKeys:@"Unable to create read stream",NSLocalizedDescriptionKey,nil]]];
return;
}
// Tell CFNetwork to automatically redirect for 30x status codes