HTTP配置
config.php
'HTTP' => [
//配置项
],
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| driver | curl | string | HTTP驱动,可选值:curl, socket |
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| ssl | 0 | int | SSL连接;0=不使用,1=单向认证,2=双向认证 CA证书 证书可在php.ini中配置,或者在站点中配置: 单向认证:将证书cacert.pem放在var/www/http/one/目录下即可 双向认证:将cacert.pem和cacert.key放在two目录下即可 |
| proxy | string | HTTP代理,格式:IP:端口 | |
| posttype | form | string | POST请求类型,可选值:form, json, xml |
| mimetype | application/x-www-form-urlencoded | string | POST请求头Content-type,默认依据posttype算出 |
| connect | 15 | int | 请求连接超时(秒) |
| execute | 0 | int | 请求执行超时(秒),0=默认 |
| header | [] | array | 附加请求头 |
| option | [] | array | curl附加选项 |
| 配置项 | 默认值 | 类型 | 说明 |
|---|---|---|---|
| ssl | 0 | int | SSL连接;0=关闭,1=开启; 证书可在php.ini中配置 openssl_get_cert_locations()检索可用证书位置 |
| proxy | string | HTTP代理,格式:IP:端口 | |
| posttype | form | string | POST请求类型,可选值:form, json, xml |
| mimetype | application/x-www-form-urlencoded | string | POST请求头Content-type,默认依据posttype算出 |
| connect | 15 | int | 请求连接超时(秒) |
| execute | 0 | int | 请求执行超时(秒),0=默认 |
| header | [] | array | 附加请求头 |