PHP code example of brokeyourbike / json-request-result
1. Go to this page and download the library: Download brokeyourbike/json-request-result library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
brokeyourbike / json-request-result example snippets
use Psr\Http\Message\ResponseInterface;
use BrokeYourBike\JsonRequestResult\JsonRequestResultTrait;
use BrokeYourBike\JsonRequestResult\JsonRequestResultInterface;
class Result implements JsonRequestResultInterface
{
use JsonRequestResultTrait;
public function __construct(ResponseInterface $response)
{
$this->statusCode = $response->getStatusCode();
$this->responseBody = (string) $response->getBody();
}
}