public function Response::isMethodAllowed

Check if an HTTP method is allowed by checking the Allow response header

Parameters

string $method Method to check:

Return value

bool

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Response.php, line 412

Class

Response
Guzzle HTTP response object

Namespace

Guzzle\Http\Message

Code

public function isMethodAllowed($method) {
  $allow = $this
    ->getHeader('Allow');
  if ($allow) {
    foreach (explode(',', $allow) as $allowable) {
      if (!strcasecmp(trim($allowable), $method)) {
        return true;
      }
    }
  }
  return false;
}