Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add patch #64

Merged
merged 1 commit into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/AblyRest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down