An Unexpected HTTP Error occurred during the API request

wordpress api
I recently changed host for my website and suddenly started seeing this message in my wordpress admin dashboard :
An Unexpected HTTP Error occurred during the API request
Made some searches and found the following explanation by 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.”
So the Solution he proposed :
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),
This should fix the issue of the “An Unexpected HTTP Error occurred during the API request“

Not working as expected
WordPress just wait longer for ‘deploy’ the error message
- Try a bigger number (45) ?
- disable all plugins and start enabling them 1 by 1 and see which one is causing the problem
This issue may also reside within the Wordpress API. The biggest culprit being sexybookmarks, it works fine on some of my sites, and not so on others, but a lot of people have found removing this from your site via ftp and refreshing your dashboard fixes it. That said, there may still be an issue with adding new plugins automatically via the dashboard, as I have had to install some manually.
Another reason for this issue in general with having lots of plugins is the cache. When you load your site and refresh, most of it has been cached, however, if you are refreshing your dashboard, none of it is cached, so you have to load everything. So 5 seconds is a bit stingy. One potential solution to that is to have supercache installed. Which allows you to cache your dashboard and thus increase the speed of your dashboards loading time.
This problem is resolved 4 out 5 times in the above given method. But for some they just have to wait until the error mysteriously disappears by itself. Wordpress has no absolute solution for it..
I am getting the error, however I don’t even have that line of code in my http.php file… Can someone give me the full code to add it to the file or could there be other causes for this error?
THANKS!