diff --git a/src/AblyRest.php b/src/AblyRest.php index 77f9b41..469c99a 100644 --- a/src/AblyRest.php +++ b/src/AblyRest.php @@ -118,7 +118,7 @@ public function post( $path, $headers = [], $params = [], $returnHeaders = false * Does a HTTP request, automatically injecting auth headers and handling fallback on server failure. * This method is used internally and `request` is the preferable method to use. * - * @param string $method HTTP method (GET, POST, PUT, DELETE, ...) + * @param string $method HTTP method (GET, POST, PUT, DELETE, PATCH, ...) * @param string $path root-relative path, e.g. /channels/example/messages * @param array $headers HTTP headers to send * @param array|string $params Array of parameters to submit or a JSON string @@ -184,7 +184,7 @@ public function requestInternal( $method, $path, $headers = [], $params = [], $r * Does an HTTP request with automatic pagination, automatically injected * auth headers and automatic server failure handling using fallbackHosts. * - * @param string $method HTTP method (GET, POST, PUT, DELETE, ...) + * @param string $method HTTP method (GET, POST, PUT, DELETE, PATCH, ...) * @param string $path root-relative path, e.g. /channels/example/messages * @param array $params GET parameters to append to $path * @param array|object $body JSON-encodable structure to send in the body - leave empty for GET requests diff --git a/src/Http.php b/src/Http.php index 632d35f..b6673d4 100644 --- a/src/Http.php +++ b/src/Http.php @@ -75,9 +75,17 @@ public function delete( $url, $headers = [], $params = [] ) { return $this->request( 'DELETE', $url, $headers, $params ); } + /** + * Wrapper to do a PATCH request + * @see Http::request() + */ + public function patch( $url, $headers = [], $params = [] ) { + return $this->request( 'PATCH', $url, $headers, $params ); + } + /** * Executes a cURL request - * @param string $method HTTP method (GET, POST, PUT, DELETE, ...) + * @param string $method HTTP method (GET, POST, PUT, DELETE, PATCH, ...) * @param string $url Absolute URL to make a request on * @param array $headers HTTP headers to send * @param array|string $params Array of parameters to submit or a JSON string