src/Service/TencentAI/OCRManager.php
protected function request($url, $image, array $options = [])
    {
        try {
            $image  = is_array($image) ? $image[0] : $image;
            $params = array_merge($options, ['image' => FileConverter::toBase64Encode($image)]);
            $params = $this->authorization->appendSignature($params);

            $http = new HTTP();
            $response = $http
                ->setHeaders(['Content-Type' => 'application/x-www-form-urlencoded'])
                ->request('POST', $url, [
                    'form_params' => $params
                ]);
        } catch (ClientException $ce) {
            $response = $response->getBody();
        }

        return $http->parseJson($response);
    }
protected function request($url, $image, array $options = [])
    {
        try {
            $image  = is_array($image) ? $image[0] : $image;
            $params = array_merge($options, ['image' => FileConverter::toBase64Encode($image)]);
            $params = $this->authorization->appendSignature($params);

            $http = new HTTP();
            $response = $http
                ->setHeaders(['Content-Type' => 'application/x-www-form-urlencoded'])
                ->request('POST', $url, [
                    'form_params' => $params
                ]);
        } catch (ClientException $ce) {
            $response = $response->getBody();
        }

        return $http->parseJson($response);
    }
发起HTTP请求，并返回JSON

@param $method
@param $url
@param $params

@throws \Exception

@return array