本文整理汇总了PHP中HttpResponse::getMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpResponse::getMessage方法的具体用法?PHP HttpResponse::getMessage怎么用?PHP HttpResponse::getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpResponse
的用法示例。
在下文中一共展示了HttpResponse::getMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: inject
/**
* Inject the dependencies from an other response.
* @param HttpResponse $httpResponse
* @return \Brickoo\Component\Http\HttpResponse
*/
public function inject(HttpResponse $httpResponse)
{
$this->version = $httpResponse->getVersion();
$this->status = $httpResponse->getStatus();
$this->message = $httpResponse->getMessage();
return $this;
}
示例2: getHttpException
/**
* Retrive http exception from HttpResponse object.
*
* @param HttpResponse $httpResponse
* @return string
*/
protected function getHttpException($httpResponse)
{
$exception = '';
$headers = $httpResponse->getHeaders();
if (isset($headers['Content-type'])) {
if (strpos(strtolower($headers['Content-type']), strtolower(Resource::Content_Type_ATOM)) !== FALSE) {
$exception = $httpResponse->getMessage();
} else {
$exception = $httpResponse->getBody();
}
} else {
$exception = $httpResponse->getMessage();
}
return $exception;
}