[HTTPClient] Add utility functions for all HTTP methods
This commit is contained in:
parent
1b8f5b7bf0
commit
5c78def973
@ -31,6 +31,9 @@ abstract class HTTPClient
|
||||
|
||||
public static function __callStatic(string $name, array $args)
|
||||
{
|
||||
if (in_array(strtoupper($name), ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'])) {
|
||||
return self::$client->request(strtoupper($name), ...$args);
|
||||
}
|
||||
return self::$client->{$name}(...$args);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user