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.

{ 5 comments… read them below or add one }
That was a great and quick tutorial! Thanks a lot for this!
You are most welcome. I hope you find other tips and tricks useful. Good luck
It seems the yahoo servers causing problems. If you just want to show a add to my yahoo button on your site to Add your RSS just paste this html code on your page.
Sometimes, we get JavaScript errors when surfing the internet. We even wonder why this error messages appears. A script in the webpage contains an error or fails to execute incorrectly is the best description for that. We should consider the browser we are using and the specific error appeared on the screen.
For anyone who’s still having this problem:
Try changing your nameserver IP’s to a different upstream DNS server. If your upstream DNS server is either off, too slow or having problems then you’ll get this issue as well.
ping api.wordpress.com and see how quickly you get a response. If it takes a while to start showing the IP address, or ping responses (even if the ping responses are fast) then the DNS server is problematic and should be changed
{ 1 trackback }