wp_safe_remote_request

SummerySummery

Retrieve the raw response from a safe HTTP request.

Syntax

wp_safe_remote_request( string $url, array $args = array() )

DescriptionDescription

This function is ideal when the HTTP request is being made to an arbitrary URL. The URL is validated to avoid redirection and request forgery attacks.

ParametersParameters

$url

(string) (Required) URL to retrieve.

$args

(array) (Optional) Request arguments.

Default value: array()

ReturnReturn

(array|WP_Error) The response or WP_Error on failure.

SourceSource

File: wp-includes/http.php


			

ChangelogChangelog

Changelog
Version Description
3.6.0 Introduced.

See alsoSee also

Scroll to Top