Automatically use HTTP pipelining for GET and HEAD requests in AFHTTPClient
This commit is contained in:
parent
d7852c19e1
commit
af99154694
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];
|
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] initWithURL:url] autorelease];
|
||||||
[request setHTTPMethod:method];
|
[request setHTTPMethod:method];
|
||||||
[request setAllHTTPHeaderFields:self.defaultHeaders];
|
[request setAllHTTPHeaderFields:self.defaultHeaders];
|
||||||
|
|
||||||
|
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"]) {
|
||||||
|
[request setHTTPShouldUsePipelining:YES];
|
||||||
|
}
|
||||||
|
|
||||||
if (parameters) {
|
if (parameters) {
|
||||||
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"] || [method isEqualToString:@"DELETE"]) {
|
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"] || [method isEqualToString:@"DELETE"]) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue