This is the static method that will help you get results from a website path with $options
are custom settings that you include from constants available from PHP.
Copy /**
* @param string $url
* @param array < string | null , string|array> $options
* @return Promise when Promise resolve InternetRequestResult and when Promise reject Error
* @throws Throwable
* @phpstan-param array{method?: string, headers?: array<int, string>, timeout?: int, body?: array<string, string>} $options
*/
public static function fetch ( string $url , array $options = []) : Promise ;
Copy $url = "https://www.google.com/" ;
System :: fetch ( $url ) -> then ( function ($value) {
var_dump ( $value ) ;
} ) -> catch ( function ($reason) {
var_dump ( $reason ) ;
} ) ;