0

I am configuring my Guzzle Request like this:

try {
   return json_decode($this->client->request('POST', https://example.com/store, $this->getOptions($data))->getBody()->getContents(), true);
        } catch (GuzzleException $e) {
               echo $e;
}

Set up my Header and Data like this:

private function getOptions($data = null)
{
    $options['headers'] = [
       'Content-Type' => 'application/json',
       'Accept'       => 'application/json'
    ];
    if ($data) {
       $options['form_params'] = $data;
       $options['json']        = $data;
    }
    return $options;
}

File is not sending. What is the problem?

Aspile Inc
  • 119
  • 2
  • 10
  • 1
    Does this answer your question? [Guzzle ~6.0 multipart and form\_params](https://stackoverflow.com/questions/30645996/guzzle-6-0-multipart-and-form-params) – H H Mar 14 '21 at 13:15
  • where is your file? – bhucho Mar 15 '21 at 08:12

0 Answers0