How to get curl headers in server How to get curl headers in server curl curl

How to get curl headers in server


Use function getallheaders() to fetch all HTTP request headers.

http://php.net/manual/en/function.getallheaders.php

And fetch result like this:

Array(    [User-Agent] => curl/7.35.0    [Host] => 127.0.0.1    [Accept] => */*    [Content-Type] => application/json    [Authorization] => 12345678)