In Zend Framework in Response Class there are two different arrays for storing headers: _headers[]
and _headersRaw[]
. And there are appropriate methods for setting each one:
setHeader(), getHeaders(), clearHeader()
and
setRawHeader(), getRawHeaders(), clearRawHeaders()
.
What is the reason to have "header" and "raw header"? Is there some special kind of usage in practice for each of these headers?
using setHeader you set key vale pair without worrying about there formatting e.g
while in case of setRawHeader() you put the whole/full header as it is with proper formating
I'm a bit late here...
Raw means that the header is not URL-encoded, whereas if the word "raw" is omitted, the header is encoded. For example:
The special characters : / ? = have been URL-encoded as
%3A %2F %3F %3D
respectively.