1560. Class

1560.1. Zend\Http\Response\Stream

Represents an HTTP response message as PHP stream resource

1560.1.1. Methods

1560.1.1.1. setContentLength

setContentLength()

Set content length

Parameters:int

1560.1.1.2. getContentLength

getContentLength()

Get content length

Return type:int|null

1560.1.1.3. getStream

getStream()

Get the response as stream

Return type:resource

1560.1.1.4. setStream

setStream()

Set the response stream

Parameters:resource
Return type:Stream

1560.1.1.5. getCleanup

getCleanup()

Get the cleanup trigger

Return type:bool

1560.1.1.6. setCleanup

setCleanup()

Set the cleanup trigger

Parameters:bool

1560.1.1.7. getStreamName

getStreamName()

Get file name associated with the stream

Return type:string

1560.1.1.8. setStreamName

setStreamName()

Set file name associated with the stream

Parameters:string – Name to set
Return type:Stream

1560.1.1.9. fromStream

fromStream()

Create a new ZendHttpResponseStream object from a stream

Parameters:
  • string
  • resource
Return type:

Stream

Throws :

ExceptionInvalidArgumentException

Throws :

ExceptionOutOfRangeException

1560.1.1.10. getBody

getBody()

Get the response body as string

This method returns the body of the HTTP response (the content), as it should be in it’s readable version - that is, after decoding it (if it was decoded), deflating it (if it was gzip compressed), etc.

If you want to get the raw body (as transferred on wire) use $this->getRawBody() instead.

Return type:string

1560.1.1.11. getRawBody

getRawBody()

Get the raw response body (as transferred “on wire”) as string

If the body is encoded (with Transfer-Encoding, not content-encoding - IE “chunked” body), gzip compressed, etc. it will not be decoded.

Return type:string

1560.1.1.12. readStream

readStream()

Read stream content and return it as string

Function reads the remainder of the body from the stream and closes the stream.

Return type:string

1560.1.1.13. __destruct

__destruct()

Destructor