# wp_remote_request()

URL: https://chugunov.pro/api-wordpress/functions/wp_remote_request/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.7.0.

## Сигнатура

```php
wp_remote_request( string $url, array $args = array() ): array|WP_Error
```

## Описание

There are other API functions available which abstract away the HTTP method:

- Default ‘GET’ for [wp_remote_get()](https://developer.wordpress.org/reference/functions/wp_remote_get/)

- Default ‘POST’ for [wp_remote_post()](https://developer.wordpress.org/reference/functions/wp_remote_post/)

- Default ‘HEAD’ for [wp_remote_head()](https://developer.wordpress.org/reference/functions/wp_remote_head/)
Important: If the URL is user-controlled, use `wp_safe_remote_request()` instead.[See also](#see-also)
- [WP_Http::request()](https://developer.wordpress.org/reference/classes/WP_Http/request/): For information on default arguments.

## Параметры

- `$url` `string` — обязательный. URL для получения.
- `$args` `array` — необязательный, по умолчанию `array()`. Request arguments.
  
  See [WP_Http::request()](https://developer.wordpress.org/reference/classes/wp_http/request/) for information on accepted arguments.

## Возвращаемое значение

`array|WP_Error` — WP_Error WP_Http::__TOKEN_1__

## Исходный код

Файл: `wp-includes/http.php:166`

```php
function wp_remote_request( $url, $args = array() ) {
	$http = _wp_http_get_object();
	return $http->request( $url, $args );
}
```

## История изменений

- 2.7.0 — Introduced.

## Связанные

Использует: [`_wp_http_get_object`](https://chugunov.pro/api-wordpress/functions/_wp_http_get_object/), `WP_Http`.
Используется в: [`wp_get_https_detection_errors`](https://chugunov.pro/api-wordpress/functions/wp_get_https_detection_errors/), `WP_Http::handle_redirects`.

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_remote_request/
