feat: return http resp as assoc array

This commit is contained in:
Victor Westerlund 2023-06-01 11:25:23 +02:00
parent 4054502b4a
commit 1d3f11e4a3

View file

@ -97,7 +97,8 @@
// The first header line and second word will contain the status code. // The first header line and second word will contain the status code.
$resp_code = (int) explode(" ", $http_response_header[0])[1]; $resp_code = (int) explode(" ", $http_response_header[0])[1];
return [$resp_code, $resp]; // Return response as [<http_status_code>, <resp_body_assoc_array>]
return [$resp_code, json_decode($resp)];
} }
// Make request and return response over socket // Make request and return response over socket