The WordPress HTTP API simplifies making remote HTTP requests: requests for information that return (and may also alter) webpage content using HyperText Transfer Protocol (HTTP), the fundamental means of communication on the internet.
The wp_remote_get(), wp_remote_post(), and wp_remote_head() functions make GET, POST, and HEAD requests, respectively. wp_remote_request() can make all forms of HTTP requests.
The HTTP responses received as the result of HTTP requests are further processed by response handler functions. Prewritten handler functions, such as wp_remote_retrieve_body() and wp_remote_retrieve_header(), greatly simplify parsing many responses.
From time to time, you'll need to call remote resources—resources on sites other than your own. A common way to do this is by making HTTP requests for the information you need. This chapter explains HTTP, and digs into WordPress's...