This commit is contained in:
Pierre-Olivier Latour
2014-04-20 10:34:45 -03:00
parent 519866bc03
commit 143ca5b99f
3 changed files with 19 additions and 18 deletions

View File

@@ -78,7 +78,7 @@
/**
* Initializes a data response from text encoded using UTF-8.
*/
- (instancetype)initWithText:(NSString*)text; // Encodes using UTF-8
- (instancetype)initWithText:(NSString*)text;
/**
* Initializes a data response from HTML encoded using UTF-8.
@@ -87,6 +87,7 @@
/**
* Initializes a data response from an HTML template encoded using UTF-8.
*
* All occurences of "%variable%" within the HTML template are replaced with
* their corresponding values.
*/

View File

@@ -46,13 +46,13 @@
/**
* Creates a client error response with the corresponding HTTP status code
* and an optional underlying NSError.
* and an underlying NSError.
*/
+ (instancetype)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
/**
* Creates a server error response with the corresponding HTTP status code
* and an optional underlying NSError.
* and an underlying NSError.
*/
+ (instancetype)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
@@ -68,13 +68,13 @@
/**
* Initializes a client error response with the corresponding HTTP status code
* and an optional underlying NSError.
* and an underlying NSError.
*/
- (instancetype)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
/**
* Initializes a server error response with the corresponding HTTP status code
* and an optional underlying NSError.
* and an underlying NSError.
*/
- (instancetype)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);

View File

@@ -31,20 +31,20 @@
* The GCDWebServerFileResponse subclass of GCDWebServerResponse reads the body
* of the HTTP response from a file on disk.
*
* It will automatically set the lastModifiedDate and eTag properties of the
* GCDWebServerResponse according to the file metadata.
* It will automatically set the contentType, lastModifiedDate and eTag
* properties of the GCDWebServerResponse according to the file extension and
* metadata.
*/
@interface GCDWebServerFileResponse : GCDWebServerResponse
/**
* Creates a response with the contents of a file and the content type
* automatically set from the file extension.
* Creates a response with the contents of a file.
*/
+ (instancetype)responseWithFile:(NSString*)path;
/**
* Creates a response like +responseWithFile: but sets the "Content-Disposition"
* HTTP header appropriately for a download if the "attachment" argument is YES.
* Creates a response like +responseWithFile: and sets the "Content-Disposition"
* HTTP header for a download if the "attachment" argument is YES.
*/
+ (instancetype)responseWithFile:(NSString*)path isAttachment:(BOOL)attachment;
@@ -57,21 +57,21 @@
+ (instancetype)responseWithFile:(NSString*)path byteRange:(NSRange)range;
/**
* Creates a response like +responseWithFile:byteRange: but also sets the
* "Content-Disposition" HTTP header appropriately for a download if the
* "attachment" argument is YES.
* Creates a response like +responseWithFile:byteRange: and sets the
* "Content-Disposition" HTTP header for a download if the "attachment"
* argument is YES.
*/
+ (instancetype)responseWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment;
/**
* Initializes a response with the contents of a file and the content type
* automatically set from the file extension.
* Initializes a response with the contents of a file.
*/
- (instancetype)initWithFile:(NSString*)path;
/**
* Initializes a response like -initWithFile: but sets the "Content-Disposition"
* HTTP header appropriately for a download if the "attachment" argument is YES.
* Initializes a response like +responseWithFile: and sets the
* "Content-Disposition" HTTP header for a download if the "attachment"
* argument is YES.
*/
- (instancetype)initWithFile:(NSString*)path isAttachment:(BOOL)attachment;