StreamContent
in package
implements
IHttpContent
Represents Stream body content for a HTTP message.
Table of Contents
Interfaces
- IHttpContent
- Represents the body content for a HTTP message.
Methods
- __construct() : mixed
- __toString() : string
- fromFile() : StreamContent
- Creates an instance from a file.
- fromRequest() : StreamContent
- Creates an instance from the raw request body.
- getStream() : Stream
- Retrieves the underlying stream.
Methods
__construct()
public
__construct(Stream $stream) : mixed
Parameters
- $stream : Stream
-
Stream that represents this message body.
__toString()
public
__toString() : string
Return values
stringfromFile()
Creates an instance from a file.
public
static fromFile(string $path) : StreamContent
Parameters
- $path : string
-
Path to the file.
Return values
StreamContent —Instance representing the provided path.
fromRequest()
Creates an instance from the raw request body.
public
static fromRequest() : StreamContent
Return values
StreamContent —Instance representing the request body.
getStream()
Retrieves the underlying stream.
public
getStream() : Stream
Return values
Stream —Underlying stream.