Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Silenced a couple of Xcode 4 warning. Don't send a serialization with…

… a GET request by default
  • Loading branch information...
commit 6ad118b82249d582cfc75ed3e8b9a18c9640032a 1 parent e03c6d3
@blakewatters blakewatters authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 Code/ObjectMapping/RKDynamicRouter.m
View
13 Code/ObjectMapping/RKDynamicRouter.m
@@ -13,7 +13,7 @@
@implementation RKDynamicRouter
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
_routes = [[NSMutableDictionary alloc] init];
}
@@ -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);
}
@@ -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];
}
Please sign in to comment.
Something went wrong with that request. Please try again.