diff --git a/source/app.d b/source/app.d index 643ba4a..f03ffab 100644 --- a/source/app.d +++ b/source/app.d @@ -348,7 +348,7 @@ class ApiClient requestString = message.serializeToJsonString; } - auto response = requestHTTP(Endpoint, + auto httpResponse = requestHTTP(Endpoint, (scope request) { request.method = HTTPMethod.POST; request.headers["Accept"] = "*/*"; @@ -356,7 +356,11 @@ class ApiClient request.headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36"; request.writeBody(cast(ubyte[])("request=" ~ requestString.urlEncode)); } - ).bodyReader.readAllUTF8; + ); + + auto response = httpResponse.bodyReader.readAllUTF8; + + httpResponse.dropBody(); return response.parseJsonString.deserializeJson!ApiResponse; }