首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
SwooleCoroutineHttppost如何请求https
$data = Swoole\Coroutine\Http\post('https://phptsest.xxxxxx.net/apisearch/a110/test/test3/', ['random_data' => time()], ['ssl' => true]); 实践中发现了Swoole\Coroutine\Http\post请求http是可行的,但是不能请求https的,文档里也没特别的参数说明,请问我该如何请求? 另外如下: function post(string $url, $data, array $options = null, array $headers = null, array $cookies = null) 能不能对$options做个详细的说明呢?
发布于5年前 · 1 次浏览 · 来自
提问
卡大大
$data = Swoole\Coroutine\Http\post('https://phptsest.xxxxxx.net/apisearch/a110/test/test3/', ['random_data' => time()], ['ssl' => true]); 实践中发现了Swoole\Coroutine\Http\post请求http是可行的,但是不能请求https的,文档里也没特别的参数说明,请问我该如何请求? 另外如下: function post(string $url, $data, array $options = null, array $headers = null, array $cookies = null) 能不能对$options做个详细的说明呢?
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2021-04-13
鲁飞
会自动处理`scheme`,`url`是`https`就会设置`true` `$options`就是`client`需要`set`的参数 源码在这里:https://github.com/swoole/library/blob/master/src/core/Coroutine/Http/functions.php
赞
0
回复
2021-04-13
卡大大
问题找到了 ./configure --with-php-config=/usr/local/php/bin/php-config --enable-openssl 加上-enable-openssl问题解决了
赞
0
回复