WP_Http::post( string $url, string|array $args = array() ): array|WP_Error

Uses the POST HTTP method.

Description

Used for sending data that is expected to be in the body.

Parameters

$urlstringrequired
The request URL.
$argsstring|arrayoptional
Override the defaults.

Default:array()

Return

array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'.
A WP_Error instance upon error.

Source

public function post( $url, $args = array() ) {
	$defaults    = array( 'method' => 'POST' );
	$parsed_args = wp_parse_args( $args, $defaults );
	return $this->request( $url, $parsed_args );
}

Changelog

VersionDescription
2.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.