The below cURL works while running shell exec but how do I format this in Guzzle?
shell_exec('curl https://*********************** -H "Authorization: *********************** -X POST -F attributes=\'{"name":"testFile.txt", "parent":{"id":"***********"}}\' -F file=@path/To/File.txt');
I want to convert the shell_exec into Guzzle format like the code below but it produces this error:
Client error:
POST https://***********************
resulted in a `405 Method Not Allowed
$response = $client->request('POST', 'https://***********************', [
'debug' => true,
'headers' => $headers,
'form_params' => [
'attributes' => [
'name' => 'testFile.txt',
'parent' => [
'id' => '***********',
]
],
'file' => '@path/To/File.txt',
]
]);
Any idea what I need to change?