Added JSON support to GCDWebServerDataResponse

This commit is contained in:
Pierre-Olivier Latour
2014-03-29 09:21:23 -07:00
parent 120f6fc864
commit eac83a4d0d
2 changed files with 15 additions and 0 deletions
+2
View File
@@ -62,9 +62,11 @@
+ (GCDWebServerDataResponse*)responseWithText:(NSString*)text;
+ (GCDWebServerDataResponse*)responseWithHTML:(NSString*)html;
+ (GCDWebServerDataResponse*)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;
+ (GCDWebServerDataResponse*)responseWithJSONObject:(id)object;
- (id)initWithText:(NSString*)text; // Encodes using UTF-8
- (id)initWithHTML:(NSString*)html; // Encodes using UTF-8
- (id)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; // Simple template system that replaces all occurences of "%variable%" with corresponding value (encodes using UTF-8)
- (id)initWithJSONObject:(id)object;
@end
@interface GCDWebServerFileResponse : GCDWebServerResponse