Unexpected HTTP Error during the API request: Fixed / Resolved

IN Marketing & Wordpress

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)

Who are we? What are we doing here? What is the meaning of life? Penny is a truth-seeker, ever-questioning, ever-learning, ever-researching, ever delving further and deeper down the rabbit hole. This site is a legacy of sorts, a place to collect thoughts, notes, book summaries, whilst providing a searchable archive to easily lookup and reference.

0 Comments

  1. Daniel says:

    This setting is now in class-http.php but did not help. Are there any other solutions?

Leave a Reply

Your email address will not be published. Required fields are marked *