wp_remote_get() not retrieving pages properly

The HTTP request sent by wp_remote_get() is different from the one that a browser sends. E.g the user-agent is different (see documentation). Some websites respond differently based on this.
The second argument of wp_remote_get() allows one to alter the request.

Websites might also respond differently depending on the IP or the number of requests received (usually by limiting or banning certain patterns).

By the way, I tested the page you mentioned and it works for me:

wp_remote_get("http://www.aljazeera.net/news/international/2016/8/24/%D9%82%D8%AA%D9%84%D9%89-%D9%88%D8%AF%D9%85%D8%A7%D8%B1-%D8%A8%D8%B2%D9%84%D8%B2%D8%A7%D9%84-%D9%8A%D8%B6%D8%B1%D8%A8-%D9%88%D8%B3%D8%B7-%D8%A5%D9%8A%D8%B7%D8%A7%D9%84%D9%8A%D8%A7");

Leave a Comment