By default, WordPress set the timeout value for cURL in wp-includes/class-wp-http-curl.php to 5 seconds and the same value is also set to HTTP requests in wp-includes/class-http.php that is a newer class for making HTTP requests that can use also cURL if it’s present in the server.
In your case, 5 seconds was not enough to perform the WP REST call, but it was enough to perform the dummy call. Generally, in terms of doing an HTTP request 5 seconds should be enough in most cases. But it seems in your WP REST endpoint you are doing too much work that need more than 5 seconds.
You can increase the timeout value to any value (15 seconds for example) by the following filter.
function custom_http_request_timeout( ) {
return 15;
}
add_filter( 'http_request_timeout', 'custom_http_request_timeout' );
Related Posts:
- wp_remote_get vs. file_get_contents vs. cURL?
- How to convert this cURL to wp_remote_*?
- Is there a way to follow redirects with command line cURL?
- How to send a header using a HTTP request through a cURL call?
- How can I set the request header for curl?
- How to display request headers with command line curl
- How to fix libeay32.dll was not found error
- cURL to show response headers after submiting a file
- wget/curl large file from google drive
- curl: (35) SSL connect error
- How do I make curl ignore the proxy?
- SSL CA cert (path? access rights?)
- How do I measure request and response times at once using cURL?
- cURL equivalent in Node.js?
- Curl Error 56 “Failure when receiving data from the peer” while sending .tar.gz File
- Run Rsync from Python [duplicate]
- HTTP request on localhost failing
- Use wp_remote_get to get JSON instagram feed from public profile
- cURL – How to send and fetch data in WordPress
- On Plugin Activation, How Do I Check for Proper Transport Mechanism?
- cURL RETURNTRANSFER function in wp_remote_post
- How to send file by wp_remote_post?
- Download file using cURL into wp-includes/uploads
- calling admin-ajax.php from admin-ajax.php
- cURL request to plugin repository fails 403
- Simulating timeout is not working
- Curl error while creating user
- Call external API in wordpress based on user input
- Inconsistencies between wp_remote_post and cURL
- Set wordpress auth cookie from external site?
- Does wp_remote_post() require curl?
- How to use the HTTP API (wp_remote_get) instead of cURL?
- Difference between `curl -I` and `curl -X HEAD`
- wp_remote_post vs curl to send data in WordPress plugin
- After upgrading WordPress, I am getting the following error. Error message: cURL error 52: Empty reply from server
- JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- HTTP POST and GET using cURL in Linux [duplicate]
- JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- What’s the net::ERR_HTTP2_PROTOCOL_ERROR about?
- How to use Python to execute a cURL command?
- How to use the curl command in PowerShell?
- How to define the basic HTTP authentication using cURL correctly?
- How to capture cURL output to a file?
- Call to undefined function curl_init().?
- How to use cURL to send Cookies?
- CURL ERROR: Recv failure: Connection reset by peer – PHP Curl
- tar: Unrecognized archive format error when trying to unpack flower_photos.tgz, TF tutorials on OSX
- Error:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
- Setting Curl’s Timeout in PHP
- How to disable cURL SSL certificate verification
- curl: no URL specified for restful api
- How to read a CSV file from a URL with Python?
- whats the meaning of curl “-s” and “-m”
- cURL 28 error after switch from to brew php 7.2 on localhost
- How to wp_upload_bits() to a sub-folder?
- Creating a post with the REST API, curl and oauth returning 401 error
- wp_remote_get() to get AJAX url /wp-admin/admin-ajax.php
- Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?
- WordPress API returns empty page when page is less than X-WP-TotalPages
- Create a WordPress post using curl comand from Linux console?
- using wp_remote_get to retrieve own url on local host
- Download failed cURL error 7: . Can’t update anything
- wp_remote_get() and javascript/noscript situation
- Upload to a remote server using wp_remote_post
- How to create a post using REST API with sending data as a JSON body?
- WordPress curl timing out and saying ‘Moved Permanently’
- wp_remote_get – curl error 28 connection timed out – using SANS in URL
- wp_remote_get times out on api request but jquery GET and postman work?
- Curl requests sent two times
- wp_remote_get sslv3 alert handshake failure
- curl problem or permalinks
- Use WP admin AJAX url to hide API key
- Fetching data from another website results in a slow website?
- Errors on a single host using wp_remote_get() unless sslverify is set to false
- Using PODS data with save_post
- @file_get_contents and wp_remote_get
- Get single item from cURL plugin API call inside bash [closed]
- How to run wp_remote_get() inside of a loop for multiple page API response?
- Uploading a media item with the wp-json API to a specific path
- WordPress HTTP API NTLM Authentication
- REST API works in browser and via AJAX but fails via cURL
- wp_remote instead of file_get_contents on non json
- Use WordPress user database in external php application
- Wrapping add_query_arg with esc_url not working
- how get number of twitter followers in wordpress
- How to write txt file?
- Proxy External API request in PHP from Edit.js in Block Plugin
- Installation failed: 504 – Gateway Timeout
- Hide response returned from WordPress REST API call
- mysqli_query(): MySQL server has gone away for Curl Request
- Daily automatic update of stock quotes via REST API and Cronjob. Or is there a more sophisticated way?
- Update products with curl (bash)
- Installation problem with wordpress xampp
- wp_remote_get() never fires
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- cURL External API request displays content above other content on page
- Displaying a remote SSL certificate details using CLI tools
- What is different about using admin-ajax.php in an endpoint and just submitting a form from the front end?
- How to run wp_remote_get() for SPA page?
- cURL running slow in WordPress