HTTPS запрашивает ошибку с HTTP_Request2 в PHP 5.4.12

У меня нет проблем с использованием PEAR HttpRequest2 для HTTP-запросов, однако эта проблема начинается, когда у меня есть API в URL-адресе HTTPS; Обратите внимание, что я использую PHP 5.4.

<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';


$request = new HTTP_Request2('https://api.transavia.com/v3/routes/',
                             HTTP_Request2::METHOD_GET, array('use_brackets' => true));

$url = $request->getUrl();

// I tried removing SSL verification, hoping it would help, it did not.
$request->setConfig(array(
    'ssl_verify_peer'   => FALSE,
    'ssl_verify_host'   => FALSE
));

// Ignore first 2 Headers; those are tests from Postman, which work, meaning the APIKey and Variables are correct
$request->setHeader(array(
  'postman-token' => '2ab78460-4e01-de66-1b31-274362f34a3e',
  'cache-control' => 'no-cache',
  'apikey' => '24e555fe917a4762a6b462cbe177dcae'
));


$url->setQueryVariables(array(
    'Origin' => 'AMS',
    'Destination' => 'ACE'
));

// This will output a page with open bugs for Net_URL2 and HTTP_Request2
echo $request->send()->getBody();


?>

Я получу ошибку

(!) Неустранимая ошибка: Uncaught HTTP_Request2_MessageException: в C:\wamp\pear\HTTP\Request2\Adapter\Socket.php в строке 1020 aaaaaa; выравнивание текста: по центру; font-weight: bold;"> Трассировка исключения cccccc; ширина:20px; font-weight: bold;"># Функция

style="text-align: center; background: #cccccc; font-weight: bold;"> Расположение 0HTTP_Request2_Response->__construct('', true, Object(Net_URL2))C:\wamp\pear\HTTP\Request2\Adapter\Socket.php:1020 1HTTP_Request2_Adapter_Socket->readResponse()C:\wamp\pear\HTTP\Request2\Adapter\Socket.php:136 2HTTP_Request2_Adapter_ в C:\wamp\pear\HTTP\Request2\Response.php в строке 21

Любые полезные отзывы будут высоко оценены


Редактировать журнал: @twicejr; Ошибка: неправильный ответ: HvTTP/1.1 200 OK

Буква "v" в "HvTTP" постоянно меняется каждый раз, когда я обновляюсь. Он переключается между b,v,¥ и т. Д.

0 ответов

Другие вопросы по тегам