public function EntityEnclosingRequest::setExpectHeaderCutoff

Set the size that the entity body of the request must exceed before adding the Expect: 100-Continue header.

Parameters

int|bool $size Cutoff in bytes. Set to false to never send the expect header (even with non-seekable data):

Return value

self

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/EntityEnclosingRequest.php, line 129

Class

EntityEnclosingRequest
HTTP request that sends an entity-body in the request message (POST, PUT, PATCH, DELETE)

Namespace

Guzzle\Http\Message

Code

public function setExpectHeaderCutoff($size) {
  $this->expectCutoff = $size;
  if ($size === false || !$this->body) {
    $this
      ->removeHeader('Expect');
  }
  elseif ($this->body && $this->body
    ->getSize() && $this->body
    ->getSize() > $size) {
    $this
      ->setHeader('Expect', '100-Continue');
  }
  return $this;
}