Added support for "If-Modified-Since" and "Accept-Encoding" headers

This commit is contained in:
Pierre-Olivier Latour
2014-04-08 22:59:29 -07:00
parent f1a79ffd11
commit 289059c875
2 changed files with 16 additions and 2 deletions
+2
View File
@@ -41,7 +41,9 @@
@property(nonatomic, readonly) NSDictionary* query; // May be nil
@property(nonatomic, readonly) NSString* contentType; // Automatically parsed from headers (nil if request has no body or set to "application/octet-stream" if a body is present without a "Content-Type" header)
@property(nonatomic, readonly) NSUInteger contentLength; // Automatically parsed from headers (NSNotFound if request has no "Content-Length" header)
@property(nonatomic, readonly) NSDate* ifModifiedSinceDate; // Automatically parsed from headers (nil if request has no "If-Modified-Since" header or it is malformatted)
@property(nonatomic, readonly) NSRange byteRange; // Automatically parsed from headers ([NSNotFound, 0] if request has no "Range" header, [offset, length] for byte range from beginning or [NSNotFound, -bytes] from end)
@property(nonatomic, readonly) BOOL acceptsGzipContentEncoding;
- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query;
- (BOOL)hasBody; // Convenience method that checks if "contentType" is not nil
- (BOOL)hasByteRange; // Convenience method that checks "byteRange"