Unexpected HTTP Error during the API request: Fixed / Resolved
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..
Open wp_include/http.php file on line 223
I used FTP and copy it to my computer to edit it:
Then I changed the timeout from 5 seconds to 30 seconds:
[cc lang=”php”]’timeout’ => apply_filters( ‘http_request_timeout’, 5),[/cc]
[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..