模拟POST请求
public static post ( string $url, array $fields, string $data_type = 'text' ) : mixed | ||
$url | string | |
$fields | array | |
$data_type | string | |
return | mixed | Examples: ``` HttpCurl::post('http://api.example.com/?a=123', array('abc'=>'123', 'efg'=>'567'), 'json'); HttpCurl::post('http://api.example.com/', '这是post原始内容', 'json'); 文件post上传 HttpCurl::post('http://api.example.com/', array('abc'=>'123', 'file1'=>'@/data/1.jpg'), 'json'); ``` |