Lines Matching refs:header

32      * Gets an array of header line values from a message for a specific header
34 * This method searches through the "headers" key of a message for a header
38 * @param string $header Header to retrieve
42 public static function headerLines($message, $header)
48 if (!strcasecmp($name, $header)) {
58 * Gets a header value from a message as a string or null
60 * This method searches through the "headers" key of a message for a header
61 * using a case-insensitive search. The lines of the header are imploded
65 * @param string $header Header to retrieve
67 * @return string|null Returns the header string if found, or null if not.
69 public static function header($message, $header)
71 $match = self::headerLines($message, $header);
76 * Returns the first header value from a message as a string or null. If
77 * a header line contains multiple values separated by a comma, then this
81 * @param string $header Header to retrieve
85 public static function firstHeader($message, $header)
89 if (!strcasecmp($name, $header)) {
101 * Returns true if a message has the provided case-insensitive header.
104 * @param string $header Header to check
108 public static function hasHeader($message, $header)
112 if (!strcasecmp($name, $header)) {
122 * Parses an array of header lines into an associative array of headers.
143 * Removes a header from a message using a case-insensitive comparison.
146 * @param string $header Header to remove
150 public static function removeHeader(array $message, $header)
154 if (!strcasecmp($header, $key)) {
167 * @param string $header Header to set.
172 public static function setHeader(array $message, $header, array $value)
174 $message = self::removeHeader($message, $header);
175 $message['headers'][$header] = $value;
190 * @throws \InvalidArgumentException if no Host header is present.
201 if ($host = self::header($request, 'host')) {
204 throw new \InvalidArgumentException('No Host header was provided');