How we get the postman google chrome headers values with PHP. Want to show the value of headers in PHP variable?
Asked
Active
Viewed 832 times
0
-
Use `HTTP_*` from [$_SERVER](http://php.net/reserved.variables.server) or use [getallheaders()](http://php.net/manual/en/function.getallheaders.php) – Lawrence Cherone Nov 30 '17 at 04:07
-
2Possible duplicate of [How do I read any request header in PHP](https://stackoverflow.com/questions/541430/how-do-i-read-any-request-header-in-php) – Ankit Patidar Nov 30 '17 at 04:36
1 Answers
1
If you are on an Apache web server you can use this php method: apache-request-headers(). This method returns an array with all incoming Request headers (coming from Postman).
Example:
<?php
print_r( apache_request_headers() );
?>
Returns:
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0
Host: www.example.com
Connection: Keep-Alive

Cagy79
- 1,610
- 1
- 19
- 25