From d5c281765b1fbf6ca6a9d3738911079b408ec87a Mon Sep 17 00:00:00 2001 From: ailiao Date: Sun, 14 Jun 2015 22:39:25 -0700 Subject: [PATCH] Add default responseData Add default responseData so that empty response bodies like for status code 204 don't result in UNIHTTPClientHelper.m returning a nil UNIHTTPResponse --- Unirest/UNIUrlConnection.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Unirest/UNIUrlConnection.m b/Unirest/UNIUrlConnection.m index df4d393..8fabfad 100644 --- a/Unirest/UNIUrlConnection.m +++ b/Unirest/UNIUrlConnection.m @@ -39,6 +39,7 @@ + (UNIUrlConnection *)sendAsynchronousRequest:(NSURLRequest *)request queue:(NSO result.request = request; result.queue = queue; result.completionHandler = completionHandler; + result->responseData = [NSMutableData data]; [result start]; return result; }