Properties

$hasCurl

$hasCurl : 

Type

$useCurl

$useCurl : 

Type

$useBasicAuth

$useBasicAuth : 

Type

$HTTPVersion

$HTTPVersion : 

Type

$host

$host : 

Type

$port

$port : 

Type

$url

$url : 

Type

$uri

$uri : 

Type

$headers

$headers : 

Type

$data

$data : 

Type

$type

$type : 

Type

$query

$query : 

Type

$timeout

$timeout : 

Type

$error

$error : 

Type

$response

$response : 

Type

$responseText

$responseText : 

Type

$responseHeaders

$responseHeaders : 

Type

$executed

$executed : 

Type

$fsock

$fsock : 

Type

$curl

$curl : 

Type

$additionalCurlOpts

$additionalCurlOpts : 

Type

$authUsername

$authUsername : 

Type

$authPassword

$authPassword : 

Type

Methods

__construct()

__construct(string  $host = '', string  $uri = '/', integer  $port = 80, boolean  $useCurl = true, integer  $timeout = 10) 

Request constructor.

Parameters

string $host
string $uri
integer $port
boolean $useCurl
integer $timeout

setHeader()

setHeader(  $header,   $content) : $this

设置header头.

Parameters

$header
$content

Returns

$this

curlHeaders()

curlHeaders() 

setHost()

setHost(  $host) : $this

设置请求的host.

Parameters

$host

Returns

$this

setRequestURI()

setRequestURI(  $uri) : $this

设置请求的URI.

Parameters

$uri

Returns

$this

setPort()

setPort(  $port) : $this

设置请求的端口.

Parameters

$port

Returns

$this

setTimeout()

setTimeout(  $timeout) : $this

设置请求的超时时间.

Parameters

$timeout

Returns

$this

setQueryParams()

setQueryParams(  $get) : $this

设置请求的参数.

Parameters

$get

Returns

$this

setUseCurl()

setUseCurl(  $use) : $this

设置是否使用curl.

Parameters

$use

Returns

$this

setType()

setType(  $type) : $this

设置请求类型.

Parameters

$type

Returns

$this

setData()

setData(  $data) : $this

设置数据.

Parameters

$data

Returns

$this

setUrl()

setUrl(  $url) : $this

设置请求的url.

Parameters

$url

Returns

$this

setAdditionalCurlOpt()

setAdditionalCurlOpt(  $option,   $value) 

设置curl的参数.

Parameters

$option
$value

setUseBasicAuth()

setUseBasicAuth(  $set,   $username = null,   $password = null) 

设置认证信息.

Parameters

$set
$username
$password

setAuthUsername()

setAuthUsername(  $username = null) 

Parameters

$username

setAuthPassword()

setAuthPassword(  $password = null) 

Parameters

$password

execute()

execute() 

param()

param(  $data) : string

Parameters

$data

Returns

string

close()

close() 

getError()

getError() 

getResponse()

getResponse() 

getResponseText()

getResponseText() 

getAllResponseHeaders()

getAllResponseHeaders() 

getResponseHeader()

getResponseHeader(  $header) 

Parameters

$header

curlExecute()

curlExecute() 

curl请求方式.

fsockgetExecute()

fsockgetExecute() 

fsock请求方式.

curlClose()

curlClose() 

fsockgetClose()

fsockgetClose()