PHP Class Wenpeng\Curl

Show file Open project: wenpeng/curl

Public Methods

Method Description
data ( ) : string Result Data
error ( ) : boolean Error status
file ( string $field, string $path, string $type, string $name ) : self File upload
info ( ) : array Task info
init ( ) : self Instance
message ( ) : string Error message
post ( array | string $data, null | string $value = null ) : self Set POST data
retry ( integer $times ) : self Set retry times
save ( string $path ) : self Save file
set ( array | string $item, null | string $value = null ) : self Set option
url ( string $url ) : self Request URL

Private Methods

Method Description
build_array ( array $input, string $pre = null ) : array Build array
process ( integer $retry ) : self Task process

Method Details

data() public method

Result Data
public data ( ) : string
return string

error() public method

Error status
public error ( ) : boolean
return boolean

file() public method

File upload
public file ( string $field, string $path, string $type, string $name ) : self
$field string
$path string
$type string
$name string
return self

info() public method

Task info
public info ( ) : array
return array

init() public static method

Instance
public static init ( ) : self
return self

message() public method

Error message
public message ( ) : string
return string

post() public method

Set POST data
public post ( array | string $data, null | string $value = null ) : self
$data array | string
$value null | string
return self

retry() public method

Set retry times
public retry ( integer $times ) : self
$times integer
return self

save() public method

Save file
public save ( string $path ) : self
$path string
return self

set() public method

Set option
public set ( array | string $item, null | string $value = null ) : self
$item array | string
$value null | string
return self

url() public method

Request URL
public url ( string $url ) : self
$url string
return self