Performs an HTTP request and returns its response.
Description
There are other API functions available which abstract away the HTTP method:
- Default ‘GET’ for wp_remote_get()
- Default ‘POST’ for wp_remote_post()
- Default ‘HEAD’ for wp_remote_head()
See also
- WP_Http::request(): For information on default arguments.
Parameters
$url
stringrequired- URL to retrieve.
$args
arrayoptional- Request arguments.
See WP_Http::request() for information on accepted arguments.Default:
array()
Send a Delete request with wp_remote_post
You can insert the DELETE method inside
wp_remote_request()
like this:Sample ConvertKit API call function using wp_remote_request()
What about calling this function? Well here’s another function which updates a contact’s email address/name