$headers Headers. * @param string|null $body Body. * @param int $timeout Seconds. * @return array{status: int, body: string}|null */ public function request( string $method, string $url, array $headers, ?string $body, int $timeout ): ?array { $args = array( 'method' => $method, 'headers' => $headers, 'timeout' => $timeout, 'redirection' => 0, ); if ( null !== $body ) { $args['body'] = $body; } $response = wp_remote_request( $url, $args ); if ( is_wp_error( $response ) ) { return null; } return array( 'status' => (int) wp_remote_retrieve_response_code( $response ), 'body' => (string) wp_remote_retrieve_body( $response ), ); } }