Something 4 Everyone!

An Unexpected HTTP Error occurred during the API request. – WordPress Solution


Note: For WordPress 3 and above here’s the solution:  An Unexpected HTTP Error occurred during the API request. – WordPress 3

When you get this error message all you have to do is follow these simple steps to resolve it. The notorious error message “An Unexpected HTTP Error occured during the API request.” appears because of the fixed timeout set by WordPress.

An Unexpected HTTP Error occurred during the API request.

This happens when the WordPress server just gives up on your request because it’s taking too long to retrieve information. The error message is pretty annoying if you were trying to install a plugin or a theme with full excitement and anticipation.

It just happened with me when I was trying to install the “Broken Link Checker” plugin on NPXP. I just couldn’t resist myself from editing the php file responsible for this error message.

Follow these simple steps to resolve the “An Unexpected HTTP Error occurred during the API request.” Error message and get the solution:

1)    Login to your FTP server

2)    Open wp_include/http.php

3)    Look out for the 223rd line inside

4)    This is what you should be looking at: ‘timeout’ => apply_filters( ‘http_request_timeout’, 5),

5)    All you have to do is change the value “5” to “30”, the value is actually is the number of seconds before the server times out.

6)    This should resolve your problem.




Guaranteed 300-400$ Per Month Online - Secrets Revealed - Download Now For Free
* indicates required







No related posts.

15 comments

  1. i didn’t find code :‘timeout’ => apply_filters( ‘http_request_timeout’, 5) in http.php

    i’m using wordpress 3.0.5

    • Hi mate,

      This solution is for the older version of WordPress… I’ll try to find if there are any new fix for this ;)

  2. Very informative article indeed. I was really getting frustrated by this wordpress error. But you have solved my problem now. Thanks

  3. eMagazine /

    i’m using wordpress 3.0.1
    it doesn’t work for me

    • Found timeout setting in class-http.php but the solution didn’t work for me. Any ideas ?

    • For me too it dint work I am using wordpress 3.1.1 :(

      any other solution for this please…

  4. My version is 3.0.1, I changed timeout value in class-http.php ! it worked for me ! Thanks alot

  5. Web Marketing Blog /

    It was so simple & have taken almost half of the day.. Thanks for sharing this information… I would recommend others to follow these simple steps & get solution as 1, 2, 3… Thanks Again…

  6. Partho /

    Doesn’t resolve the problem for me.

  7. Thanks for the info, this problem got in my client site. I just got your post and solved by following your steps.

  8. Robert /

    PYou can find this setting in the class-http.php file.
    Btw it doesn’t helped me :(

    • My friends who have faced this problem have got it resolved through this solution. Hmmm…

  9. Rahinur Rahaman /

    This solution is not work for WordPress v3.0. Please provide the version number which you solved for.

    Thanks!

Trackbacks/Pingbacks

  1. An Unexpected HTTP Error occurred during the API request. – Wordpress 3 Solution - [...] apply_filters( ‘http_request_timeout’, 30),For the previous Wordpress version you can try this:http://npxp.com/an-unexpected-http-error-occurred-during-the-api-request-wordpress-solutionAn Unexpected HTTP Error occurred during the API request. ...