An Unexpected HTTP Error occured during the API request.
Recently, I have been checking out tons of plugins to find out the best one for my sites. You know how tough and time consuming it is to go through each plugins, test them out, keep the good ones, throw the bad ones. So here it goes, I installed several plugins on one of my other blog.
I logged into WordPress and tried to install a new plugin from the dashboard and came across the following error:
“An Unexpected HTTP Error occured during the API request.”
I tried adding a new post, editing a post but nothing seemed to work.
The time given is too long in the process of requesting the API plugin in the wordpress server so that the operation timed out according to WP user efree_unix. WordPress gives 5 seconds time limit to request a plugin by default. If within 5 seconds it does not get a replay, the process will come to an halt and display an error “An Unexpected HTTP error occurred during the API request.”
Solution:
An Unexpected HTTP Error occured during the API request.
Open wp_include/http.php file on line 223
The easy way to do this is by opening the file using notepad, go to edit, find and search for “http_request_timeout”. The first result should be the one we are looking for.
‘timeout’ => apply_filters( ‘http_request_timeout’, 5),
Now change the code above into the following:
‘timeout’ => apply_filters( ‘http_request_timeout’, 30),
All you need to do is, change the 5 to a 30, refresh the page and Bingo!!
You might not face this problem now but you never know what lies ahead. Feel free to bookmark this post in order to save you time looking for it in the future.
Check Out Related Posts:
- Solution for “500 Internal Server Error” After Installing Some Plugins
- 10 Free Plugins To Make Your WordPress Blog Super Fast
- Top WordPress Optimization Tips
- The Recent WordPress Blog Hacks and How To Prevent Them
- 4 Important Rules When Using WordPress















