0

I try sending custom HTTP header from Postman but the server doesn't recognize it in

isset($_SERVER["HTTP_AUTH_TOKEN"] 

returns false, also I tried

var_dump($_SERVER)

and my parameter isn't there

However, it works fine on localhost, but it won't work when I upload it on godaddy hosting for example?

The suggested solution doesn't work for me..

MahmutTariq
  • 217
  • 1
  • 4
  • 17

2 Answers2

0

Try this one:

$headers = apache_request_headers();        
$headers['HTTP_AUTH_TOKEN'];

It worked for me.

0

I have found the solution.

The problem was in adding extra _ symbol in the header variable, worked fine when I set the variable with no _ symbol..

MahmutTariq
  • 217
  • 1
  • 4
  • 17
  • I should have realized when I looked at your image o the headers at https://i.stack.imgur.com/hjrc4.png It says `headers(3)`, but you only show 2, so I guess that you cut off the one that would have let us help you. Did you learn anything from that, or your next question? – Mawg says reinstate Monica Oct 22 '17 at 11:39
  • The last one was the content-type, that doesn't change anything – MahmutTariq Oct 22 '17 at 13:42