开发者

Custom User-Agent not showing up in _SERVER variable

In my Java app I am using a custom User-Agent in the http post message. The idea is to something a little different for one post message based on the User-Agent.

On the server side I am using PHP and turns out the $_SERVER array does not have the HTTP_USER_AGENT set. I can see it is set when I send a regular GET message from the browser to the php code. What's 开发者_StackOverflow社区puzzling is the User-Agent is in fact getting set in my Java code and I can see it using tcpdump. After wasting a lot of time I figured out that the User-Agent is in fact sent correctly and I could get it using the apache_request_headers() function in my php code. Though it solves my problem I really want to understand what's going on. Did anyone else face this problem? Can someone explain why I am seeing this? I am new to PHP.

EDIT: Here is the User-Agent specific field copied and pasted from wireshark on the client side.

User-Agent: Android app1.0\r\n

Thanks,

P

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜