Skip to content

Commit

Permalink
Silenced a couple of Xcode 4 warning. Don't send a serialization with…
Browse files Browse the repository at this point in the history
… a GET request by default
  • Loading branch information
blakewatters committed Mar 2, 2011
1 parent e03c6d3 commit 6ad118b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Code/ObjectMapping/RKDynamicRouter.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@implementation RKDynamicRouter

- (id)init {
if (self = [super init]) {
if ((self = [super init])) {
_routes = [[NSMutableDictionary alloc] init];
}

Expand Down Expand Up @@ -80,11 +80,11 @@ - (NSString*)resourcePathForObject:(NSObject<RKObjectMappable>*)object method:(R
NSDictionary* classRoutes = [_routes objectForKey:className];

NSString* resourcePath = nil;
if (resourcePath = [classRoutes objectForKey:methodName]) {
if ((resourcePath = [classRoutes objectForKey:methodName])) {
return RKMakePathWithObject(resourcePath, object);
}

if (resourcePath = [classRoutes objectForKey:@"ANY"]) {
if ((resourcePath = [classRoutes objectForKey:@"ANY"])) {
return RKMakePathWithObject(resourcePath, object);
}

Expand All @@ -94,6 +94,13 @@ - (NSString*)resourcePathForObject:(NSObject<RKObjectMappable>*)object method:(R
}

- (NSObject<RKRequestSerializable>*)serializationForObject:(NSObject<RKObjectMappable>*)object method:(RKRequestMethod)method {
// Don't return a serialization for a GET request
// There is an extensive discussion about this on the ASIHTTPRequest list
// See http://groups.google.com/group/asihttprequest/browse_thread/thread/ef79a8333dde6acb
if (method == RKRequestMethodGET) {
return nil;
}

// By default return a form encoded serializable dictionary
return [object propertiesForSerialization];
}
Expand Down

0 comments on commit 6ad118b

Please sign in to comment.