Skip to content

Commit

Permalink
MicroHTTPKit: Implement missing Constructor in HKHTTPResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder committed Mar 6, 2024
1 parent 0da7238 commit a298564
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Libraries/MicroHTTPKit/Source/HKHTTPResponse.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString *, NSString *> *)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 {
Expand Down

0 comments on commit a298564

Please sign in to comment.