diff --git a/src/Client.php b/src/Client.php index 88fb4e3..d97cc3e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -532,6 +532,20 @@ public function post($endpoint, array $params = []) return $this->api($endpoint, $params, Method::POST); } + /** + * Make API call to LinkedIn using DELETE method + * + * @param string $endpoint + * @param array $params + * + * @return array + * @throws \LinkedIn\Exception + */ + public function delete($endpoint, array $params = []) + { + return $this->api($endpoint, $params, Method::DELETE); + } + /** * @param $path * @return array diff --git a/src/Http/Method.php b/src/Http/Method.php index d0b5c8d..bd95661 100644 --- a/src/Http/Method.php +++ b/src/Http/Method.php @@ -72,7 +72,7 @@ class Method extends AbstractEnum */ public static function isMethodSupported($method) { - if (!in_array($method, [Method::GET, Method::POST])) { + if (!in_array($method, [Method::GET, Method::POST, Method::DELETE])) { throw new \InvalidArgumentException('The method is not correct'); } }