BATCH_MODE_SERVER_PARALLEL
BATCH_MODE_SERVER_PARALLEL = 0
Client for Baidu OpenAPI2.0 service.
$batchMode : int
Mode of batch/run api
$batchQueue : array
Array of api calls to be batch run.
& api(string $uri, array $params = array(), string $httpMethod = 'GET', string $type = 'rest') : array|false
Call an api which is opened by Baidu, file upload apis should not be called by this interface.
string | $uri | Uri for the api, it could be the whole url, like 'https://openapi.baidu.com/rest/2.0/passport/user/info/get', or url path only, like '/rest/2.0/passport/user/info/get', or just api method only, like 'passport/user/info/get'. |
array | $params | Api specific parameters. |
string | $httpMethod | Http method, could be 'GET' or 'POST'. |
string | $type | Type name of the openapi, could be 'rest', or 'public'. |
Returns an array if success, or false if failed.
upload(string $uri, $params = array()) : \Returns
Call a file upload api.
string | $uri | Uri for the api, it could be the whole url, like 'https://openapi.baidu.com/file/2.0/cloudalbum/picture/upload', or just api method only, like 'cloudalbum/picture/upload', if the api is provided under the domain of openapi.baidu.com. |
$params | Api specific parameters. |
an array if success, or false if failed.