连接以后提示 The plain HTTP request was sent to HTTPS port.
AsyncTcpConnection不支持https
牛人,有没有可能让他支持?框架非常赞啊。不支持的话始终有点遗憾
https://github.com/walkor/Workerman 支持了,请更新下Workerman的代码
http://doc.workerman.net/components/workerman-http-client.html
<?php require __DIR__ . '/vendor/autoload.php'; use Workerman\Worker; $worker = new Worker(); $worker->onWorkerStart = function(){ $http = new Workerman\Http\Client(); $http->get('https://example.com/', function($response){ var_dump($response->getStatusCode()); echo $response->getBody(); }, function($exception){ echo $exception; }); $http->post('https://example.com/', ['key1'=>'value1','key2'=>'value2'], function($response){ var_dump($response->getStatusCode()); echo $response->getBody(); }, function($exception){ echo $exception; }); $http->request('https://example.com/', [ 'method' => 'POST', 'version' => '1.1', 'headers' => ['Connection' => 'keep-alive'], 'data' => ['key1' => 'value1', 'key2'=>'value2'], 'success' => function ($response) { echo $response->getBody(); }, 'error' => function ($exception) { echo $exception; } ]); }; Worker::runAll();
非常感谢
不客气
已经更新
AsyncTcpConnection不支持https
牛人,有没有可能让他支持?框架非常赞啊。不支持的话始终有点遗憾
https://github.com/walkor/Workerman
支持了,请更新下Workerman的代码
http://doc.workerman.net/components/workerman-http-client.html
非常感谢
不客气
已经更新