Open bellazhouyi opened 7 years ago
Just subclass HTTPDataResponse
. For example:
// JSONHTTPResponse.h
#import <Cocoa/Cocoa.h>
#import <CocoaHTTPServer/HTTPDataResponse.h>
@interface JSONHTTPResponse : HTTPDataResponse
@end
// JSONHTTPResponse.m
#import "JSONHTTPResponse.h"
@implementation JSONHTTPResponse
- (NSDictionary *)httpHeaders {
return @{@"Content-Type": @"application/json"};
}
@end
Thanks
i want add content_type to response,but i don't know how to added? thanks to answer the question.