diff --git a/Libraries/MicroHTTPKit/Source/HKHTTPResponse.m b/Libraries/MicroHTTPKit/Source/HKHTTPResponse.m index 6bcba46..d197bc3 100644 --- a/Libraries/MicroHTTPKit/Source/HKHTTPResponse.m +++ b/Libraries/MicroHTTPKit/Source/HKHTTPResponse.m @@ -53,6 +53,16 @@ + (instancetype)responseWithJSONObject:(id)JSONObject return [[self alloc] initWithJSONObject:JSONObject status:status error:error]; } ++ (instancetype)responseWithJSONObject:(id)JSONObject + status:(NSUInteger)status + headers:(NSDictionary *)headers + error:(NSError **)error { + NSData *data; + data = [NSJSONSerialization dataWithJSONObject:JSONObject options:0 error:error]; + + return [[self alloc] initWithData:data headers:headers status:status]; +} + - (instancetype)initWithJSONObject:(id)JSONObject status:(NSUInteger)status error:(NSError **)error {