Search code examples
gethttprequestwap

HTTP Request from a PC to load the contents of a wap site


When I try to load a wap site with PHP HTTP request from my PC, host of the web site recognizes that I'm sending the request from a PC and redirects me to their actual web site and I can't load the wap site. Is there a way to behave like a mobile browser and prevent this redirection? Although an answer regarding any programming language is ok, a php specific answer will be better.


Solution

  • This behavior is normally dictated by the User-Agent string on the HTTP request. You can usually spoof the User-Agent string, and replace it with the user-agent of a mobile device, or if you're using Firefox, you can download a User-Agent Switcher plugin.