public static function EntityBody::fromString

Create a new EntityBody from a string

Parameters

string $string String of data:

Return value

EntityBody

1 call to EntityBody::fromString()
EntityBody::factory in drupal/core/vendor/guzzle/http/Guzzle/Http/EntityBody.php
Create a new EntityBody based on the input type

File

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

Class

EntityBody
Entity body used with an HTTP request or response

Namespace

Guzzle\Http

Code

public static function fromString($string) {
  $stream = fopen('php://temp', 'r+');
  fwrite($stream, $string);
  rewind($stream);
  return new static($stream);
}