|
|
The Zend\Http\Headers class is a container for HTTP headers. It
is typically accessed as part of a Zend\Http\Request or
Zend\Http\Response header() call. The
Headers container will lazily load actual Header objects as to reduce the overhead of
header specific parsing.
The Zend\Http\Header\* classes are the domain specific
implementations for the various types of Headers that one might encounter during the
typical HTTP request. If a header of unknown type is encountered, it will be
implemented as a Zend\Http\Header\GenericHeader instance. See
the below table for a list of the various HTTP headers and the API that is specific to
each header type.
The quickest way to get started interacting with header objects is by getting an already populated Headers container from a request or response object.
None currently available.
Populates headers from string representation
Parses a string for headers, and aggregates them, in order, in the current instance, primarily as strings until they are needed (they will be lazy loaded).
Returns Zend\Http\Headers
Set an alternate implementation for the plugin class loader
Returns Zend\Http\Headers
Return an instance of a
Zend\Loader\PluginClassLocator, lazyload and inject
map if necessary.
Returns Zend\Loader\PluginClassLocator
Add many headers at once
Expects an array (or Traversable object) of type/value pairs.
Returns Zend\Http\Headers
Add a raw header line, either in name => value, or as a single string 'name: value'
This method allows for lazy-loading in that the parsing and instantiation of Header object will be delayed until they are retrieved by either get() or current().
Returns Zend\Http\Headers
Add a Header to this container, for raw values see addHeaderLine() and addHeaders().
Returns Zend\Http\Headers
Remove a Header from the container
Returns bool
Clear all headers
Removes all headers from queue
Returns Zend\Http\Headers
Get all headers of a certain name/type
Returns
false|Zend\Http\Header\HeaderDescription|ArrayIterator
Test for existence of a type of header
Returns bool
Advance the pointer for this object as an interator
Returns void
Return the current key for this object as an interator
Returns mixed
Is this iterator still valid?
Returns bool
Reset the internal pointer for this object as an iterator
Returns void
Return the current value for this iterator, lazy loading it if need be
Returns Zend\Http\Header\HeaderDescription
Return the number of headers in this container. If all headers have not been parsed, actual count could increase if MultipleHeader objects exist in the Request/Response. If you need an exact count, iterate.
Returns int
Render all headers at once
This method handles the normal iteration of headers; it is up to the concrete classes to prepend with the appropriate status/request line.
Returns string
Return the headers container as an array
Returns array
By calling this, it will force parsing and loading of all headers, after this count() will be accurate
Returns bool
Factory to generate a header object from a string
Returns Zend\Http\Header\GenericHeader
Retrieve header field name
Returns string
Retrieve header field value
Returns string
Cast to string as a well formed HTTP header line
Returns in form of "NAME: VALUE\r\n"
Returns string
| Class Name | Additional Methods |
|---|---|
| Accept | N/A |
| AcceptCharset | N/A |
| AcceptEncoding | N/A |
| AcceptLanguage | N/A |
| AcceptRanges |
getRangeUnit() / setRangeUnit() - The range unit of the accept ranges header |
| Age | getDeltaSeconds() / setDeltaSeconds() - The age in delta seconds |
| Allow | getAllowedMethods() / setAllowedMethods() - An array of allowed methods |
| AuthenticationInfo | N/A |
| Authorization | N/A |
| CacheControl | N/A |
| Connection | N/A |
| ContentDisposition | N/A |
| ContentEncoding | N/A |
| ContentLanguage | N/A |
| ContentLength | N/A |
| ContentLocation | N/A |
| ContentMD5 | N/A |
| ContentRange | N/A |
| ContentType | N/A |
| Cookie |
Extends \ArrayObject setEncodeValue() / getEncodeValue() - Whether or not to encode values |
| Date | N/A |
| Etag | N/A |
| Expect | N/A |
| Expires | N/A |
| From | N/A |
| Host | N/A |
| IfMatch | N/A |
| IfModifiedSince | N/A |
| IfNoneMatch | N/A |
| IfRange | N/A |
| IfUnmodifiedSince | N/A |
| KeepAlive | N/A |
| LastModified | N/A |
| Location | N/A |
| MaxForwards | N/A |
| Pragma | N/A |
| ProxyAuthenticate | N/A |
| ProxyAuthorization | N/A |
| Range | N/A |
| Referer | N/A |
| Refresh | N/A |
| RetryAfter | N/A |
| Server | N/A |
| SetCookie |
getName() / setName() - The cookies name getValue() / setValue() - The cookie value getDomain() / setDomain() - The domain the cookie applies to getExpires() / setExpires() - The time frame the cookie is valid for, null is a session cookie getPath() / setPath() - The uri path the cookie is bound to isSecure() / setSecure() - Whether the cookies contains the Secure flag isHttponly() / setHttponly() - Whether the cookies can be accessed via HTTP only |
| TE | N/A |
| Trailer | N/A |
| TransferEncoding | N/A |
| Upgrade | N/A |
| UserAgent | N/A |
| Vary | N/A |
| Via | N/A |
| Warning | N/A |
| WWWAuthenticate | N/A |
|
|
Copyright © 2005-2011 Zend Technologies Inc (compiled by mikaelkael with ZFDocumentor - GIT c517eb0).

