$DROP_QUERY_PARAMS
$DROP_QUERY_PARAMS
List of query parameters that get automatically dropped when rebuilding the current URL.
Utils class for Baidu OpenAPI2.0 SDK.
request(string $url, array $params = array(), string $httpMethod = 'GET', bool $multi = false) : string|false
Request for a http/https resource
string | $url | Url to request |
array | $params | Parameters for the request |
string | $httpMethod | Http method, 'GET' or 'POST' |
bool | $multi | Whether it's a multipart POST request |
Returns string if success, or false if failed
generateSign(array $params, string $secret, string $namespace = 'sign') : string
Generate the signature for passed parameters.
array | $params | Array of parameters to be signatured |
string | $secret | Secret key for signature |
string | $namespace | The parameter which will be excluded when calculate the signature |
Signature of the parameters
detectMimeType(mixed $filename) : string
Tries to detect MIME type of a file
The method will try to use fileinfo extension if it is available, deprecated mime_content_type() function in the other case. If neither works, default 'application/octet-stream' MIME type is returned
mixed | $filename |
file MIME type