public function EntityBody::getContentType

Guess the Content-Type or return the default application/octet-stream

Return value

string

Overrides EntityBodyInterface::getContentType

See also

http://www.php.net/manual/en/function.finfo-open.php

File

drupal/core/vendor/guzzle/http/Guzzle/Http/EntityBody.php, line 141

Class

EntityBody
Entity body used with an HTTP request or response

Namespace

Guzzle\Http

Code

public function getContentType() {
  if (!($this
    ->isLocal() && $this
    ->getWrapper() == 'plainfile' && file_exists($this
    ->getUri()))) {
    return 'application/octet-stream';
  }
  return Mimetypes::getInstance()
    ->fromFilename($this
    ->getUri()) ?: 'application/octet-stream';
}