Posts

Showing posts with the label HTTP Headers By Key

How to get custom HTTP Headers PHP

This blog is about how to read All/Custom headers in PHP. Below code is used to get all Headers. $headers = getallheaders(); There is an alternative for getting HTTP headers. apache_request_headers() These functions are getting all HTTP headers like below:- Array ( [ Host ] => localhost [ Connection ] => keep - alive [ Content - Length ] => 171 [ Authorization ] => "My Custom Header Yo Yo!!" [ Postman - Token ] => 4 c6308bd - da37 - 6 fdf - 6806 - f945c59136f8 [ Cache - Control ] => no - cache [ Origin ] => chrome - extension: //fhbjgbiflinjbdggehcddcbncdddomop [ User - Agent ] => Mozilla / 5.0 ( Windows NT 10.0 ; Win64 ; x64 ) AppleWebKit / 537.36 ( KHTML , like Gecko ) Chrome / 54.0 . 2840.71 Safari / 537.36 [ Content - Type ] => application / json [ Accept ] => */* [ Accept - Encoding ] => gzip , deflate , br [ Accept - Language ] => ...