Added more logging calls to \ncc\Utilities > HttpClient
https://git.n64.cc/nosial/ncc/-/issues/29
This commit is contained in:
parent
4f9f78e21d
commit
f521c3291d
1 changed files with 13 additions and 0 deletions
|
@ -64,6 +64,12 @@
|
|||
if (count($httpRequest->Headers) > 0)
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $httpRequest->Headers);
|
||||
|
||||
Console::outDebug(sprintf(' => %s request %s', $httpRequest->Type, $httpRequest->Url));
|
||||
if($httpRequest->Headers !== null && count($httpRequest->Headers) > 0)
|
||||
Console::outDebug(sprintf(' => headers: %s', implode(', ', $httpRequest->Headers)));
|
||||
if($httpRequest->Body !== null)
|
||||
Console::outDebug(sprintf(' => body: %s', $httpRequest->Body));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
if ($response === false)
|
||||
|
@ -82,6 +88,13 @@
|
|||
$httpResponse->Headers = self::parseHeaders($headers);
|
||||
$httpResponse->Body = $body;
|
||||
|
||||
Console::outDebug(sprintf(' <= %s response', $httpResponse->StatusCode));/** @noinspection PhpConditionAlreadyCheckedInspection */
|
||||
if($httpResponse->Headers !== null && count($httpResponse->Headers) > 0)
|
||||
Console::outDebug(sprintf(' <= headers: %s', implode(', ', $httpResponse->Headers)));
|
||||
/** @noinspection PhpConditionAlreadyCheckedInspection */
|
||||
if($httpResponse->Body !== null)
|
||||
Console::outDebug(sprintf(' <= body: %s', $httpResponse->Body));
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
return $httpResponse;
|
||||
|
|
Loading…
Add table
Reference in a new issue