Merge pull request #376 from AFNetworking/experimental-default-http-pipelining
Automatically use HTTP pipelining for GET and HEAD requests in AFHTTPClient
This commit is contained in:
commit
d1e993f1fd
1 changed files with 4 additions and 0 deletions
|
|
@ -453,6 +453,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
|||
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] initWithURL:url] autorelease];
|
||||
[request setHTTPMethod:method];
|
||||
[request setAllHTTPHeaderFields:self.defaultHeaders];
|
||||
|
||||
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"]) {
|
||||
[request setHTTPShouldUsePipelining:YES];
|
||||
}
|
||||
|
||||
if (parameters) {
|
||||
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"] || [method isEqualToString:@"DELETE"]) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue