\Curl

CodeIgniter Curl Class

Work with remote servers via cURL much easier than using the native PHP bindings.

Summary

Methods
Properties
Constants
__construct()
__call()
_simple_call()
simple_ftp_get()
post()
put()
patch()
delete()
set_cookies()
http_header()
http_method()
http_login()
proxy()
proxy_login()
ssl()
options()
option()
create()
execute()
is_enabled()
debug()
debug_request()
set_defaults()
curlRequest()
$error_code
$error_string
$info
No constants found
No protected methods found
$_ci
$response
$session
$url
$options
$headers
N/A
No private methods found
No private properties found
N/A

Properties

$error_code

$error_code : 

Type

$error_string

$error_string : 

Type

$info

$info : 

Type

$_ci

$_ci : 

Type

$response

$response : 

Type

$session

$session : 

Type

$url

$url : 

Type

$options

$options : 

Type

$headers

$headers : 

Type

Methods

__construct()

__construct(  $url = '') 

Parameters

$url

__call()

__call(  $method,   $arguments) 

Parameters

$method
$arguments

_simple_call()

_simple_call(  $method,   $url,   $params = array(),   $options = array()) 

Parameters

$method
$url
$params
$options

simple_ftp_get()

simple_ftp_get(  $url,   $file_path,   $username = '',   $password = '') 

Parameters

$url
$file_path
$username
$password

post()

post(  $params = array(),   $options = array()) 

Parameters

$params
$options

put()

put(  $params = array(),   $options = array()) 

Parameters

$params
$options

patch()

patch(  $params = array(),   $options = array()) 

Parameters

$params
$options

delete()

delete(  $params,   $options = array()) 

Parameters

$params
$options

set_cookies()

set_cookies(  $params = array()) 

Parameters

$params

http_header()

http_header(  $header,   $content = NULL) 

Parameters

$header
$content

http_method()

http_method(  $method) 

Parameters

$method

http_login()

http_login(  $username = '',   $password = '',   $type = 'any') 

Parameters

$username
$password
$type

proxy()

proxy(  $url = '',   $port = 80) 

Parameters

$url
$port

proxy_login()

proxy_login(  $username = '',   $password = '') 

Parameters

$username
$password

ssl()

ssl(  $verify_peer = TRUE,   $verify_host = 2,   $path_to_cert = NULL) 

Parameters

$verify_peer
$verify_host
$path_to_cert

options()

options(  $options = array()) 

Parameters

$options

option()

option(  $code,   $value,   $prefix = 'opt') 

Parameters

$code
$value
$prefix

create()

create(  $url) 

Parameters

$url

execute()

execute() 

is_enabled()

is_enabled() 

debug()

debug() 

debug_request()

debug_request() 

set_defaults()

set_defaults() 

curlRequest()

curlRequest(string  $url = '', array  $data = array(), array  $headers = array()) : string

创建一个CURL网络访问

Parameters

string $url

要访问的地址

array $data

要POST的值

array $headers

要附加的HTTP头信息

Returns

string —

返回服务器的响应, false请求失败