Phue\Transport\Http::sendRequest PHP Метод

sendRequest() публичный Метод

Send request
public sendRequest ( string $address, string $method = self::METHOD_GET, stdClass $body = null ) : string
$address string API address
$method string Request method
$body stdClass Post body
Результат string Request response
    public function sendRequest($address, $method = self::METHOD_GET, \stdClass $body = null)
    {
        $jsonResults = $this->getJsonResponse($address, $method, $body);
        // Get first element in array if it's an array response
        if (is_array($jsonResults)) {
            $jsonResults = $jsonResults[0];
        }
        // Get error type
        if (isset($jsonResults->error)) {
            throw $this->getExceptionByType($jsonResults->error->type, $jsonResults->error->description);
        }
        // Get success object only if available
        if (isset($jsonResults->success)) {
            $jsonResults = $jsonResults->success;
        }
        return $jsonResults;
    }