Tags
cURL, file_get_contents, sockets, WP HTTP API, wp_remote_get, wp_remote_post, wp_remote_retrieve_body
What is WordPress HTTP API ?
Do you want to make a request to any remote server to get something or to post something ? WordPress HTTP API is the solution for you. It provides a simple interface to make remote requests. It supports methods such as POST, GET, HEAD, PUT, etc. Below are some of the helper functions it provides.
wp_remote_get() - Retrieves a URL using the GET HTTP method.
wp_remote_post() - Retrieves a URL using the POST HTTP method.
wp_remote_head() - Retrieves a URL using the HEAD HTTP method.
wp_remote_request() - Retrieves a URL using either the default GET or a custom HTTP method.
Continue reading