HTTP配置
config.php
'HTTP' => [
//配置项
],
HTTP配置
配置项 | 默认值 | 类型 | 说明 |
---|---|---|---|
driver | curl | string | HTTP驱动,可选值:curl, socket |
curl驱动
配置项 | 默认值 | 类型 | 说明 |
---|---|---|---|
ssl | 0 | int | SSL连接;0=不使用,1=单向认证,2=双向认证 CA证书 |
proxy | string | HTTP代理,格式:IP:端口 | |
posttype | form | string | POST请求类型,可选值:form, json, xml |
mimetype | application/x-www-form-urlencoded | string | POST请求头Content-type,一般无需手动设置 |
timeout_connect | 15 | int | 请求连接超时(秒) |
timeout_execute | 0 | int | 请求执行超时(秒),0=默认 |
header | [] | array | 附加请求头 |
option | [] | array | curl附加选项 |
socket驱动
配置项 | 默认值 | 类型 | 说明 |
---|---|---|---|
ssl | 0 | int | SSL连接;0=关闭,1=开启 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,一般无需手动设置 |
persist | false | bool | 是否打开持久连接 |
timeout_connect | 15 | int | 请求连接超时(秒) |
timeout_execute | 0 | int | 请求执行超时(秒),0=默认 |
header | [] | array | 附加请求头 |