mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 12:27:52 +08:00
Eliminate duplication of request method to string logic in [RKRequest HTTPMethod]
This commit is contained in:
@@ -419,27 +419,8 @@ RKRequestMethod RKRequestMethodTypeFromName(NSString *methodName) {
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*)HTTPMethod {
|
||||
switch (_method) {
|
||||
case RKRequestMethodGET:
|
||||
return @"GET";
|
||||
break;
|
||||
case RKRequestMethodPOST:
|
||||
return @"POST";
|
||||
break;
|
||||
case RKRequestMethodPUT:
|
||||
return @"PUT";
|
||||
break;
|
||||
case RKRequestMethodDELETE:
|
||||
return @"DELETE";
|
||||
break;
|
||||
case RKRequestMethodHEAD:
|
||||
return @"HEAD";
|
||||
break;
|
||||
default:
|
||||
return nil;
|
||||
break;
|
||||
}
|
||||
- (NSString *)HTTPMethod {
|
||||
return RKRequestMethodNameFromType(self.method);
|
||||
}
|
||||
|
||||
// NOTE: We could factor the knowledge about the queue out of RKRequest entirely, but it will break behavior.
|
||||
|
||||
Reference in New Issue
Block a user