Socket
扩展 AbstractTransport用于直接使用套接字的 HTTP 传输类。
| 自 |
1.0 |
|---|---|
| 包 |
Joomla 框架 |
方法
__construct
构造函数。
__construct(array|\ArrayAccess options = []) :
继承
| 自 |
2.0.0 |
|---|---|
| 抛出 |
|
参数
- options
array<string|int, mixed>|ArrayAccess客户端选项数组。
响应
混合
connect
连接到服务器并获取资源的方法。
connect(\Joomla\Uri\UriInterface uri, timeout = null) :
getOption
从 HTTP 传输中获取选项。
getOption( key, default = null) :
继承
| 自 |
2.0.0 |
|---|
参数
- key
string要获取的选项的名称。- default
mixed如果未设置选项,则为默认值。
响应
mixed选项值。
getResponse
从服务器响应中获取响应对象的方法。
getResponse( content) : \Joomla\Http\Response
| 自 |
1.0 |
|---|---|
| 抛出 |
|
参数
- content
string完整的服务器响应,包括标题。
响应
isSupported
检查 HTTP 传输套接字是否可用于的方法
isSupported() :
静态
| 自 |
1.0 |
|---|
响应
bool如果可用,则为真,否则为假
processHeaders
处理来自传输响应数据的标题。
processHeaders(mixed||string|int headers) : mixed||string|int
继承
| 自 |
2.0.0 |
|---|
参数
- headers
array<string|int, mixed>要处理的标题。
响应
array<string|int, mixed>
request
向服务器发送请求并返回带有响应的响应对象。
request( method, \Joomla\Uri\UriInterface uri, data = null, mixed||string|int headers = [], timeout = null, userAgent = null) : \Joomla\Http\Response
| 自 |
1.0 |
|---|---|
| 抛出 |
|
参数
- method
string用于发送请求的 HTTP 方法。- uri
UriInterface要请求的资源的 URI。- data
mixed与请求一起发送的关联数组或字符串。- headers
array<string|int, mixed>要与请求一起发送的请求标题数组。- timeout
int以秒为单位的读取超时。- userAgent
string要与请求一起发送的可选用户代理字符串。
响应
属性
options
客户端选项。
继承
| 自 |
2.0.0 |
|---|
类型
array<string|int, mixed>|ArrayAccess
connections
可重用套接字连接。
| 自 |
1.0 |
|---|
类型
array<string|int, mixed>