Permalink
Browse files

Eliminate duplication of request method to string logic in [RKRequest…

… HTTPMethod]
  • Loading branch information...
1 parent ada95e0 commit e681b85be40634363be8d1ec72403d7022ead163 @blakewatters blakewatters committed May 19, 2012
Showing with 2 additions and 21 deletions.
  1. +2 −21 Code/Network/RKRequest.m
@@ -419,27 +419,8 @@ - (void)cancelAndInformDelegate:(BOOL)informDelegate {
}
}
-- (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.

0 comments on commit e681b85

Please sign in to comment.