I have created an API request and try to access the header parameter from that request using the $_POST
method but didn't get header request data.
Here is my header request data:
Access-Key:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Content-Type:application/json
charset:utf-8
So how can I get fetch all header data using PHP? Can anybody help me?
try this
$url = 'your url';
echo $type = get_headers($url, 1)["Access-Key"];