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?