Skip to content

Commit

Permalink
Allow lowercase http verbs in requests. #108
Browse files Browse the repository at this point in the history
  • Loading branch information
Sventour committed Sep 13, 2016
1 parent 38d1068 commit d13bc21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Vimeo/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function request($url, $params = array(), $method = 'GET', $json_body = t
// add accept header hardcoded to version 3.0
$headers[] = 'Accept: ' . self::VERSION_STRING;
$headers[] = 'User-Agent: ' . self::USER_AGENT;
$method = strtoupper($method);

// add bearer token, or client information
if (!empty($this->_access_token)) {
Expand All @@ -90,7 +91,7 @@ public function request($url, $params = array(), $method = 'GET', $json_body = t

// Set the methods, determine the URL that we should actually request and prep the body.
$curl_opts = array();
switch (strtoupper($method)) {
switch ($method) {
case 'GET' :
if (!empty($params)) {
$query_component = '?' . http_build_query($params, '', '&');
Expand All @@ -115,7 +116,7 @@ public function request($url, $params = array(), $method = 'GET', $json_body = t
$curl_url = self::ROOT_ENDPOINT . $url;
$curl_opts = array(
CURLOPT_POST => true,
CURLOPT_CUSTOMREQUEST => strtoupper($method),
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_POSTFIELDS => $body
);
break;
Expand Down

0 comments on commit d13bc21

Please sign in to comment.