//方式一:直接用laravel自带的http客户端,一行搞定
$response = Http::withHeaders($headers)->attach('file', fopen($file_dir, 'r'))->post($url, ['meta' => $body_json]);
//方式二:用GuzzleHttp客户端,其实方式一也是封装了GuzzleHttp,但更加便捷。
$client = new Client();
$r = $client->request('POST', $url, [
'headers' => $headers,
'multipart' => [
'name' => 'file',
'contents' => fopen($file_dir, 'r'),