An Unexpected HTTP Error occured during the API request -FIXED

by S Ahsan · View Comments

in Blogging

An Unexpected HTTP Error occured during the API request.

An Unexpected HTTP Error occured during the API request.

You know I run about a billion websites.  My  newest project, San Francisco Dance Music Coalition is taking longer than expected to get up and running.  First I couldn’t find a decent customizable (and cool looking) theme and secondly I couldn’t install any dang plugins!
When I was logged into WP (2.8.4) and I tried to install a new plugin (from the dashboard), I would get the following error:
“An Unexpected HTTP Error occured during the API request.”
Basically, according to WP user efree_unix,
The cause of error is too long in the process of requesting the API plugin in the wordpress server so that the operation timed out. By default, wordpress give 5 seconds time limit to request a plugin. If within 5 seconds does not get a replay, then the process will be stopped and displayed an error “An Unexpected HTTP error occurred during the API request.”
THE SOLUTION:
Open wp_include/http.php file on line 223
‘timeout’ => apply_filters( ‘http_request_timeout’, 5),
change the script above into
‘timeout’ => apply_filters( ‘http_request_timeout’, 30),
That’s it, refresh and be merry!

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.

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:


  • http://realurl.org/twitted.php?id=5849304633 Twitted by ahsanmedia

    [...] This post was Twitted by ahsanmedia [...]

  • http://nurselabs.co.cc/ NurseLabs

    That was a great and quick tutorial! Thanks a lot for this! :)

  • http://www.mastermindblogger.com S Ahsan

    You are most welcome. I hope you find other tips and tricks useful. Good luck

  • http://www.firstireland.com/ProductCart/pc/viewCategories.asp Lladro figurines

    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.

  • http://www.flowerwizard.com/ mothers day flowers

    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.

blog comments powered by Disqus

Previous post:

Next post: