Title: WP_HTTP_Requests_Hooks::__construct
Published: December 6, 2016
Last modified: August 20, 2026

---

# WP_HTTP_Requests_Hooks::__construct( string $url, array $request )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_http_requests_hooks/__construct/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_http_requests_hooks/__construct/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_http_requests_hooks/__construct/?output_format=md#related)

Constructor.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_http_requests_hooks/__construct/?output_format=md#parameters)󠁿

 `$url`stringrequired

URL to request.

`$request`arrayrequired

Request data in [WP_Http](https://developer.wordpress.org/reference/classes/wp_http/)
format.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_http_requests_hooks/__construct/?output_format=md#source)󠁿

    ```php
    public function __construct( $url, $request ) {
    	$this->url     = $url;
    	$this->request = $request;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-requests-hooks.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-http-requests-hooks.php#L39)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-http-requests-hooks.php#L39-L42)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_http_requests_hooks/__construct/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Http::request()](https://developer.wordpress.org/reference/classes/wp_http/request/)`wp-includes/class-wp-http.php` |

Send an HTTP request to a URI.

  |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_http_requests_hooks%2F__construct%2F)
before being able to contribute a note or feedback.