How to send Fast Excel to Guzzle post request

326 Views Asked by At

i use Fast Excel library from https://github.com/rap2hpoutre/fast-excel, can i put return from ->download('file.xlsx') to Guzzle post request? with this code i'm not get anything

      $httpClient = new \GuzzleHttp\Client([
        'headers' => [
          'Authorization' => mdmTokenGenerate($token),
          'Accept' => 'application/json'
        ],
        'verify' => false
      ]);

      $response = $httpClient->post(
        "{$client->domain}/api/push", [
          'multipart' => [
            [
              'name' => 'file',
              'contents' =>  (new FastExcel(MasterNumbers::limit(1000)->get()))->download('file.xlsx')
            ]
          ]
        ]
      );
0

There are 0 best solutions below