Skip to content

Commit 55a44ec

Browse files
authored
Merge pull request #17 from sarhugo/16-enable-delete-method
16 enable delete method
2 parents 804e4ab + 0dc80ac commit 55a44ec

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/Client.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,20 @@ public function post($endpoint, array $params = [])
532532
return $this->api($endpoint, $params, Method::POST);
533533
}
534534

535+
/**
536+
* Make API call to LinkedIn using DELETE method
537+
*
538+
* @param string $endpoint
539+
* @param array $params
540+
*
541+
* @return array
542+
* @throws \LinkedIn\Exception
543+
*/
544+
public function delete($endpoint, array $params = [])
545+
{
546+
return $this->api($endpoint, $params, Method::DELETE);
547+
}
548+
535549
/**
536550
* @param $path
537551
* @return array

src/Http/Method.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Method extends AbstractEnum
7272
*/
7373
public static function isMethodSupported($method)
7474
{
75-
if (!in_array($method, [Method::GET, Method::POST])) {
75+
if (!in_array($method, [Method::GET, Method::POST, Method::DELETE])) {
7676
throw new \InvalidArgumentException('The method is not correct');
7777
}
7878
}

0 commit comments

Comments
 (0)