Represents an HTTP response message as PHP stream resource

 Methods

Destructor

__destruct() 

Allow PHP casting of this object

__toString() : string
Inherited

inherited_from \Zend\Http\AbstractMessage::__toString()
inherited_from \Zend\Http\Response::__toString()

Returns

string

Create a new Zend\Http\Response\Stream object from a stream

fromStream(string $responseString, resource $stream) : \Zend\Http\Response\Stream

Parameters

$responseString

string

$stream

resource

Exceptions

\Zend\Http\Exception\InvalidArgumentException
\Zend\Http\Exception\OutOfRangeException

Returns

Populate object from string

fromString(string $string) : \Zend\Http\self
Inherited

inherited_from \Zend\Http\Response::fromString()

Parameters

$string

string

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

\Zend\Http\self

Get the response body as string

getBody() : 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.

Returns

string

Get the cleanup trigger

getCleanup() : bool

Returns

bool

Get message content

getContent() : mixed
Inherited

inherited_from \Zend\Stdlib\Message::getContent()
inherited_from \Zend\Http\AbstractMessage::getContent()
inherited_from \Zend\Http\Response::getContent()

Returns

mixed

Get content length

getContentLength() : int | null

Returns

intnull

getCookie()

getCookie() : \Zend\Http\Header\SetCookie[]
Inherited

inherited_from \Zend\Http\Response::getCookie()

Returns

Return the header container responsible for headers

getHeaders() : \Zend\Http\Headers
Inherited

inherited_from \Zend\Http\AbstractMessage::getHeaders()
inherited_from \Zend\Http\Response::getHeaders()

Returns

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

getRawBody() : string

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

Returns

string

Get HTTP status message

getReasonPhrase() : string
Inherited

inherited_from \Zend\Http\Response::getReasonPhrase()

Returns

string

Retrieve HTTP status code

getStatusCode() : int
Inherited

inherited_from \Zend\Http\Response::getStatusCode()

Returns

int

Get the response as stream

getStream() : resource

Returns

resource

Get file name associated with the stream

getStreamName() : string

Returns

string

Return the HTTP version for this request

getVersion() : string
Inherited

inherited_from \Zend\Http\AbstractMessage::getVersion()
inherited_from \Zend\Http\Response::getVersion()

Returns

string

Does the status code indicate a client error?

isClientError() : bool
Inherited

inherited_from \Zend\Http\Response::isClientError()

Returns

bool

Is the request forbidden due to ACLs?

isForbidden() : bool
Inherited

inherited_from \Zend\Http\Response::isForbidden()

Returns

bool

Is the current status "informational"?

isInformational() : bool
Inherited

inherited_from \Zend\Http\Response::isInformational()

Returns

bool

Does the status code indicate the resource is not found?

isNotFound() : bool
Inherited

inherited_from \Zend\Http\Response::isNotFound()

Returns

bool

Do we have a normal, OK response?

isOk() : bool
Inherited

inherited_from \Zend\Http\Response::isOk()

Returns

bool

Do we have a redirect?

isRedirect() : bool
Inherited

inherited_from \Zend\Http\Response::isRedirect()

Returns

bool

Does the status code reflect a server error?

isServerError() : bool
Inherited

inherited_from \Zend\Http\Response::isServerError()

Returns

bool

Was the response successful?

isSuccess() : bool
Inherited

inherited_from \Zend\Http\Response::isSuccess()

Returns

bool

Render the status line header

renderStatusLine() : string
Inherited

inherited_from \Zend\Http\Response::renderStatusLine()

Returns

string

Set the cleanup trigger

setCleanup(bool $cleanup) 

Parameters

$cleanup

bool

Set message content

setContent(mixed $value) : \Zend\Stdlib\Message
Inherited

inherited_from \Zend\Stdlib\Message::setContent()
inherited_from \Zend\Http\AbstractMessage::setContent()
inherited_from \Zend\Http\Response::setContent()

Parameters

$value

mixed

Returns

Set content length

setContentLength(int $contentLength) 

Parameters

$contentLength

int

Set custom HTTP status code

setCustomStatusCode(int $code) : \Zend\Http\self
Inherited

inherited_from \Zend\Http\Response::setCustomStatusCode()

Parameters

$code

int

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

\Zend\Http\self

Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders())

setHeaders(\Zend\Http\Headers $headers) : \Zend\Http\AbstractMessage
Inherited

see \Zend\Http\getHeaders()
inherited_from \Zend\Http\AbstractMessage::setHeaders()
inherited_from \Zend\Http\Response::setHeaders()

Parameters

Returns

setReasonPhrase()

setReasonPhrase(string $reasonPhrase) : \Zend\Http\self
Inherited

inherited_from \Zend\Http\Response::setReasonPhrase()

Parameters

$reasonPhrase

string

Returns

\Zend\Http\self

Set HTTP status code and (optionally) message

setStatusCode(int $code) : \Zend\Http\self
Inherited

inherited_from \Zend\Http\Response::setStatusCode()

Parameters

$code

int

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

\Zend\Http\self

Set the response stream

setStream(resource $stream) : \Zend\Http\Response\Stream

Parameters

$stream

resource

Returns

Set file name associated with the stream

setStreamName(string $streamName) : \Zend\Http\Response\Stream

Parameters

$streamName

string

Name to set

Returns

Set the HTTP version for this object, one of 1.0 or 1.1 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11)

setVersion(string $version) : \Zend\Http\AbstractMessage
Inherited

inherited_from \Zend\Http\AbstractMessage::setVersion()
inherited_from \Zend\Http\Response::setVersion()

Parameters

$version

string

(Must be 1.0 or 1.1)

Exceptions

\Zend\Http\Exception\InvalidArgumentException

Returns

Render entire response as HTTP response string

toString() : string
Inherited

inherited_from \Zend\Http\Response::toString()

Returns

string

Decode a "chunked" transfer-encoded body and return the decoded text

decodeChunkedBody(string $body) : string
Inherited

inherited_from \Zend\Http\Response::decodeChunkedBody()

Parameters

$body

string

Exceptions

\Zend\Http\Exception\RuntimeException

Returns

string

Decode a zlib deflated message (when Content-encoding = deflate)

decodeDeflate(string $body) : string
Inherited

Currently requires PHP with zlib support

inherited_from \Zend\Http\Response::decodeDeflate()

Parameters

$body

string

Exceptions

\Zend\Http\Exception\RuntimeException

Returns

string

Decode a gzip encoded message (when Content-encoding = gzip)

decodeGzip(string $body) : string
Inherited

Currently requires PHP with zlib support

inherited_from \Zend\Http\Response::decodeGzip()

Parameters

$body

string

Exceptions

\Zend\Http\Exception\RuntimeException

Returns

string

Read stream content and return it as string

readStream() : string

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

Returns

string

 Properties

 

Should we clean up the stream file when this response is closed?

$cleanup : bool

 

$content

$content : string
Inherited

inherited_from \Zend\Stdlib\Message::$$content
inherited_from \Zend\Http\AbstractMessage::$$content
inherited_from \Zend\Http\Response::$$content
 

The Content-Length value, if set

$contentLength : int

 

The portion of the body that has already been streamed

$contentStreamed : int

 

$headers

$headers : \Zend\Http\Headers | null
Inherited

inherited_from \Zend\Http\AbstractMessage::$$headers
inherited_from \Zend\Http\Response::$$headers
   

<p>Null means it will be looked up from the $reasonPhrase list above</p>

$reasonPhrase : string | null
Inherited

inherited_from \Zend\Http\Response::$$reasonPhrase
 

<p>Recommended Reason Phrases</p>

$recommendedReasonPhrases : array
Inherited

inherited_from \Zend\Http\Response::$$recommendedReasonPhrases
 

<p>Status code</p>

$statusCode : int
Inherited

inherited_from \Zend\Http\Response::$$statusCode
 

Response as stream

$stream : resource

 

The name of the file containing the stream

$streamName : string

Will be empty if stream is not file-based.

 

$version

$version : string
Inherited

inherited_from \Zend\Http\AbstractMessage::$$version
inherited_from \Zend\Http\Response::$$version

 Constants

 

STATUS_CODE_100

STATUS_CODE_100 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_100
 

STATUS_CODE_101

STATUS_CODE_101 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_101
 

STATUS_CODE_102

STATUS_CODE_102 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_102
 

STATUS_CODE_200

STATUS_CODE_200 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_200
 

STATUS_CODE_201

STATUS_CODE_201 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_201
 

STATUS_CODE_202

STATUS_CODE_202 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_202
 

STATUS_CODE_203

STATUS_CODE_203 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_203
 

STATUS_CODE_204

STATUS_CODE_204 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_204
 

STATUS_CODE_205

STATUS_CODE_205 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_205
 

STATUS_CODE_206

STATUS_CODE_206 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_206
 

STATUS_CODE_207

STATUS_CODE_207 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_207
 

STATUS_CODE_208

STATUS_CODE_208 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_208
 

STATUS_CODE_300

STATUS_CODE_300 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_300
 

STATUS_CODE_301

STATUS_CODE_301 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_301
 

STATUS_CODE_302

STATUS_CODE_302 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_302
 

STATUS_CODE_303

STATUS_CODE_303 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_303
 

STATUS_CODE_304

STATUS_CODE_304 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_304
 

STATUS_CODE_305

STATUS_CODE_305 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_305
 

STATUS_CODE_306

STATUS_CODE_306 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_306
 

STATUS_CODE_307

STATUS_CODE_307 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_307
 

STATUS_CODE_400

STATUS_CODE_400 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_400
 

STATUS_CODE_401

STATUS_CODE_401 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_401
 

STATUS_CODE_402

STATUS_CODE_402 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_402
 

STATUS_CODE_403

STATUS_CODE_403 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_403
 

STATUS_CODE_404

STATUS_CODE_404 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_404
 

STATUS_CODE_405

STATUS_CODE_405 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_405
 

STATUS_CODE_406

STATUS_CODE_406 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_406
 

STATUS_CODE_407

STATUS_CODE_407 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_407
 

STATUS_CODE_408

STATUS_CODE_408 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_408
 

STATUS_CODE_409

STATUS_CODE_409 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_409
 

STATUS_CODE_410

STATUS_CODE_410 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_410
 

STATUS_CODE_411

STATUS_CODE_411 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_411
 

STATUS_CODE_412

STATUS_CODE_412 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_412
 

STATUS_CODE_413

STATUS_CODE_413 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_413
 

STATUS_CODE_414

STATUS_CODE_414 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_414
 

STATUS_CODE_415

STATUS_CODE_415 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_415
 

STATUS_CODE_416

STATUS_CODE_416 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_416
 

STATUS_CODE_417

STATUS_CODE_417 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_417
 

STATUS_CODE_418

STATUS_CODE_418 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_418
 

STATUS_CODE_422

STATUS_CODE_422 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_422
 

STATUS_CODE_423

STATUS_CODE_423 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_423
 

STATUS_CODE_424

STATUS_CODE_424 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_424
 

STATUS_CODE_425

STATUS_CODE_425 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_425
 

STATUS_CODE_426

STATUS_CODE_426 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_426
 

STATUS_CODE_428

STATUS_CODE_428 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_428
 

STATUS_CODE_429

STATUS_CODE_429 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_429
 

STATUS_CODE_431

STATUS_CODE_431 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_431
 

STATUS_CODE_500

STATUS_CODE_500 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_500
 

STATUS_CODE_501

STATUS_CODE_501 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_501
 

STATUS_CODE_502

STATUS_CODE_502 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_502
 

STATUS_CODE_503

STATUS_CODE_503 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_503
 

STATUS_CODE_504

STATUS_CODE_504 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_504
 

STATUS_CODE_505

STATUS_CODE_505 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_505
 

STATUS_CODE_506

STATUS_CODE_506 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_506
 

STATUS_CODE_507

STATUS_CODE_507 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_507
 

STATUS_CODE_508

STATUS_CODE_508 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_508
 

STATUS_CODE_511

STATUS_CODE_511 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_511
 

STATUS_CODE_CUSTOM

STATUS_CODE_CUSTOM 
Inherited

inherited_from \Zend\Http\Response::STATUS_CODE_CUSTOM
 

VERSION_10

VERSION_10 
Inherited

inherited_from \Zend\Http\AbstractMessage::VERSION_10
inherited_from \Zend\Http\Response::VERSION_10
 

VERSION_11

VERSION_11 
Inherited

inherited_from \Zend\Http\AbstractMessage::VERSION_11
inherited_from \Zend\Http\Response::VERSION_11