Method |
Description |
|
_DELETE ( $url, $params = null, $username = null, $password = null ) : RESTClient |
DELETE wrapper for delete data |
|
_GET ( $url, $params = null, $username = null, $password = null ) : RESTClient |
GET wrapper for get data |
|
_POST ( $url, $params = null, $username = null, $password = null, $contentType = null ) : RESTClient |
POST wrapper for insert data |
|
_POST_FOPEN ( $url, $params = null, $username = null, $password = null, $contentType = null ) |
|
|
_PUT ( $url, $params = null, $username = null, $password = null, $contentType = null ) : RESTClient |
PUT wrapper for update data |
|
__construct ( ) |
|
|
_photoUpload ( $url, $postdata, $files ) |
|
|
call ( $url, $method, $postFields = null, $username = null, $password = null, $contentType = null ) : RESTClient |
Execute calls |
|
call_fopen ( $url, $method, $postFields = null, $username = null, $password = null, $contentType = null ) |
|
|
close ( ) |
Closes the connection and release resources |
|
convertEncoding ( $source, $in, $out ) |
|
|
create_post_body ( $post_params ) |
|
|
do_post_request ( $url, $postdata, $files ) : mixed |
POST wrapper,不基于curl函数,环境可以不支持curl函数 |
|
getHeader ( $ch, $header ) |
Get the header info to store. |
|
get_http_url ( ) |
parses the url and rebuilds it to be
scheme://host/path |
|
json_foreach ( $jsonArr ) |
将stdclass object转换成数组,并转换编码 |
|
objectToArray ( $obj ) |
|
|
parseResponse ( $resp, $ext = '' ) |
*
Parse response, including json, xml, plain text |
|
setAuthorizeInfo ( $username, $password ) |
Set the authorize info for Basic Authentication |
|
setContentType ( string $contentType ) |
Set the Content-Type of the request to be send
Format like "application/json" or "application/xml" or "text/plain" or other |
|
setDecodeFormat ( $format = null ) : boolean |
Sets the format type to be decoded |
|
setEncode ( $encode ) |
|
|
setFormat ( $format = null ) : boolean |
Sets the format type to be extension |
|
setMethod ( $method ) |
Set the Request HTTP Method |
|
setNotFollow ( ) : RESTClient |
Settings that won't follow redirects |
|
setParameters ( $params ) |
Set Parameters to be send on the request
It can be both a key/value par array (as in array("key"=>"value"))
or a string containing the body of the request, like a XML, JSON or other
Proper content-type should be set for the body if not a array |
|
setURL ( $url ) |
Sets the URL to be Called |
|
to_postdata ( ) |
builds the data one would send in a POST request |
|
to_url ( ) |
builds a url usable for a GET request |
|
xml_decode ( $data, $toArray = false ) |
*
XML decode |
|