Add support for creating an NSMutableURLRequest for a relationship

This commit is contained in:
Blake Watters
2012-09-10 18:00:15 -04:00
parent 216306722f
commit c7bc76711d
2 changed files with 30 additions and 0 deletions

View File

@@ -166,6 +166,16 @@ static BOOL RKDoesArrayOfResponseDescriptorsContainEntityMapping(NSArray *respon
return [self.HTTPClient requestWithMethod:RKStringFromRequestMethod(method) path:[URL relativeString] parameters:parameters];
}
- (NSMutableURLRequest *)requestWithPathForRelationship:(NSString *)relationship
ofObject:(id)object
method:(RKRequestMethod)method
parameters:(NSDictionary *)parameters
{
NSURL *URL = [self.router URLForRelationship:relationship ofObject:object method:method];
NSAssert(URL, @"No relationship route found for the '%@' class with the name '%@'", NSStringFromClass([object class]), relationship);
return [self.HTTPClient requestWithMethod:RKStringFromRequestMethod(method) path:[URL relativeString] parameters:parameters];
}
- (NSMutableURLRequest *)requestWithObject:(id)object
method:(RKRequestMethod)method
path:(NSString *)path