One of the API I am consuming requires a header to be a JSON string. I did send the headers in the JSON type but it doesn't seem to work. I am not sure what is the mistake I am making here.
$json = json_encode(
[
"parent_id" => "FgzDPEyJRhb-xZLC9yVhGOyaVQypI2TDSO6NQsnS",
"name" => "dummy-1.txt",
]
);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization : ApiKey XXX',
'X-Kloudless-Metadata :'.$json,
));
The response I get is missing parent_id and name in the request.