wp_remote_post

函数


wp_remote_post ( $url, $args = array() )
参数
  • (string)
    $url
    URL to retrieve.
    Required:
  • (array)
    $args
    Optional. Request arguments. Default empty array.
    Required:
    Default: array()
返回值
  • (array|WP_Error) The response or WP_Error on failure.
相关
  • wp_remote_request()
  • WP_Http::request()
定义位置
  • wp-includes/http.php
    , line 177
引入
2.7.0
弃用

Performs an HTTP request using the POST method and returns its response.

function wp_remote_post( $url, $args = array() ) {
	$http = _wp_http_get_object();
	return $http->post( $url, $args );
}