mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-22 11:46:05 +08:00
Merge branch 'master' of github.com:twotoasters/RestKit into new-example
This commit is contained in:
@@ -189,7 +189,7 @@ NSString* RKMakePathWithObject(NSString* path, id object);
|
||||
/**
|
||||
* Fetch a resource via an HTTP GET
|
||||
*/
|
||||
- (RKRequest*)get:(NSString*)resourcePath delegate:(id)delegate;
|
||||
- (RKRequest*)get:(NSString*)resourcePath delegate:(NSObject<RKRequestDelegate>*)delegate;
|
||||
|
||||
/**
|
||||
* Fetch a resource via an HTTP GET with a dictionary of params
|
||||
@@ -197,21 +197,21 @@ NSString* RKMakePathWithObject(NSString* path, id object);
|
||||
* Note that this request _only_ allows NSDictionary objects as the params. The dictionary will be coerced into a URL encoded
|
||||
* string and then appended to the resourcePath as the query string of the request.
|
||||
*/
|
||||
- (RKRequest*)get:(NSString*)resourcePath queryParams:(NSDictionary*)queryParams delegate:(id)delegate;
|
||||
- (RKRequest*)get:(NSString*)resourcePath queryParams:(NSDictionary*)queryParams delegate:(NSObject<RKRequestDelegate>*)delegate;
|
||||
|
||||
/**
|
||||
* Create a resource via an HTTP POST with a set of form parameters
|
||||
*/
|
||||
- (RKRequest*)post:(NSString*)resourcePath params:(NSObject<RKRequestSerializable>*)params delegate:(id)delegate;
|
||||
- (RKRequest*)post:(NSString*)resourcePath params:(NSObject<RKRequestSerializable>*)params delegate:(NSObject<RKRequestDelegate>*)delegate;
|
||||
|
||||
/**
|
||||
* Update a resource via an HTTP PUT
|
||||
*/
|
||||
- (RKRequest*)put:(NSString*)resourcePath params:(NSObject<RKRequestSerializable>*)params delegate:(id)delegate;
|
||||
- (RKRequest*)put:(NSString*)resourcePath params:(NSObject<RKRequestSerializable>*)params delegate:(NSObject<RKRequestDelegate>*)delegate;
|
||||
|
||||
/**
|
||||
* Destroy a resource via an HTTP DELETE
|
||||
*/
|
||||
- (RKRequest*)delete:(NSString*)resourcePath delegate:(id)delegate;
|
||||
- (RKRequest*)delete:(NSString*)resourcePath delegate:(NSObject<RKRequestDelegate>*)delegate;
|
||||
|
||||
@end
|
||||
|
||||
@@ -231,20 +231,24 @@
|
||||
}
|
||||
|
||||
- (BOOL)isHTML {
|
||||
return [[self contentType] rangeOfString:@"text/html" options:NSCaseInsensitiveSearch|NSAnchoredSearch].length > 0 ||
|
||||
[self isXHTML];
|
||||
NSString* contentType = [self contentType];
|
||||
return contentType && ([contentType rangeOfString:@"text/html" options:NSCaseInsensitiveSearch|NSAnchoredSearch].length > 0 ||
|
||||
[self isXHTML]);
|
||||
}
|
||||
|
||||
- (BOOL)isXHTML {
|
||||
return [[self contentType] rangeOfString:@"application/xhtml+xml" options:NSCaseInsensitiveSearch|NSAnchoredSearch].length > 0;
|
||||
NSString* contentType = [self contentType];
|
||||
return contentType && [contentType rangeOfString:@"application/xhtml+xml" options:NSCaseInsensitiveSearch|NSAnchoredSearch].length > 0;
|
||||
}
|
||||
|
||||
- (BOOL)isXML {
|
||||
return [[self contentType] rangeOfString:@"application/xml" options:NSCaseInsensitiveSearch|NSAnchoredSearch].length > 0;
|
||||
NSString* contentType = [self contentType];
|
||||
return contentType && [contentType rangeOfString:@"application/xml" options:NSCaseInsensitiveSearch|NSAnchoredSearch].length > 0;
|
||||
}
|
||||
|
||||
- (BOOL)isJSON {
|
||||
return [[self contentType] rangeOfString:@"application/json" options:NSCaseInsensitiveSearch|NSAnchoredSearch].length > 0;
|
||||
NSString* contentType = [self contentType];
|
||||
return contentType && [contentType rangeOfString:@"application/json" options:NSCaseInsensitiveSearch|NSAnchoredSearch].length > 0;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user