Unexpected HTTP Error during the API request: Fixed / Resolved

IN Marketing & Wordpress
  • Updated:7 years ago
  • Reading Time:1Minute
  • Post Words:255Words
Print Friendly, PDF & Email

Unexpected HTTP Error during the API request

Kept getting this damn An Unexpected HTTP Error occurred during the API request during the past week all of a sudden – usually when I want to write a new post or upgrade on a plugin, or pretty much any link I choose in the backend. 

Annoying but usually refreshing the page and just staying on that tab would get it back up and running again – but I like to multi-task, so when one tab is loading one thing, I’m usually in another tab doing something else, so tonight I decided to see if there was a simple resolution, and thanks to this post on the WordPress.org forums, I was able to fix it, although it’s more of a bandaid fix, since I’m not sure why it started all of a sudden and didn’t used to do it – probably some beautiful plugin that I can’t live without lol.. 

Unexpected HTTP Error

Open wp_include/http.php file on line 223

I used FTP and copy it to my computer to edit it:

Unexpected HTTP Error

Then I changed the timeout from 5 seconds to 30 seconds:

From this:

[cc lang=”php”]’timeout’ => apply_filters( ‘http_request_timeout’, 5),[/cc]

To this:

[cc lang=”php”]’timeout’ => apply_filters( ‘http_request_timeout’, 30),[/cc]

Worked for me and several others who are having the same problem, so if you are having this problem, you might also wish to try it.

Please feel free to share your ideas if you have other possible solutions for others.. 

Penny (PennyButler.com)
Penny (PennyButler.com)

Truth-seeker, ever-questioning, ever-learning, ever-researching, ever delving further and deeper, ever trying to 'figure it out'. This site is a legacy of sorts, a place to collect thoughts, notes, book summaries, & random points of interests.