}
if (!$this->isSuccess) {
- Logger::notice('http error', ['url' => $this->url, 'code' => $this->getReturnCode(), 'error' => $this->error, 'callstack' => System::callstack(20)]);
+ Logger::notice('http error', ['url' => $this->url, 'code' => $this->getReturnCode(), 'error' => $this->error, 'callstack' => System::callstack(20)]);
Logger::debug('debug', ['info' => $this->getHeaders()]);
}
/** {@inheritDoc} */
public function getContentType()
{
- return $this->getHeader('Content-Type');
+ $contentTypes = $this->getHeader('Content-Type') ?? [];
+ return array_pop($contentTypes) ?? '';
}
/** {@inheritDoc} */
{
return $this->isTimeout;
}
+
+ /// @todo - fix mismatching use of "getBody()" as string here and parent "getBody()" as streaminterface
+ public function getBody()
+ {
+ return parent::getBody()->getContents();
+ }
}