[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 namespace GuzzleHttp\Message; 3 4 use GuzzleHttp\Stream\StreamInterface; 5 6 /** 7 * Request and response message interface 8 */ 9 interface MessageInterface 10 { 11 /** 12 * Get a string representation of the message 13 * 14 * @return string 15 */ 16 public function __toString(); 17 18 /** 19 * Get the HTTP protocol version of the message 20 * 21 * @return string 22 */ 23 public function getProtocolVersion(); 24 25 /** 26 * Sets the body of the message. 27 * 28 * The body MUST be a StreamInterface object. Setting the body to null MUST 29 * remove the existing body. 30 * 31 * @param StreamInterface|null $body Body. 32 */ 33 public function setBody(StreamInterface $body = null); 34 35 /** 36 * Get the body of the message 37 * 38 * @return StreamInterface|null 39 */ 40 public function getBody(); 41 42 /** 43 * Gets all message headers. 44 * 45 * The keys represent the header name as it will be sent over the wire, and 46 * each value is an array of strings associated with the header. 47 * 48 * // Represent the headers as a string 49 * foreach ($message->getHeaders() as $name => $values) { 50 * echo $name . ": " . implode(", ", $values); 51 * } 52 * 53 * @return array Returns an associative array of the message's headers. 54 */ 55 public function getHeaders(); 56 57 /** 58 * Retrieve a header by the given case-insensitive name. 59 * 60 * @param string $header Case-insensitive header name. 61 * 62 * @return string 63 */ 64 public function getHeader($header); 65 66 /** 67 * Retrieves a header by the given case-insensitive name as an array of strings. 68 * 69 * @param string $header Case-insensitive header name. 70 * 71 * @return string[] 72 */ 73 public function getHeaderAsArray($header); 74 75 /** 76 * Checks if a header exists by the given case-insensitive name. 77 * 78 * @param string $header Case-insensitive header name. 79 * 80 * @return bool Returns true if any header names match the given header 81 * name using a case-insensitive string comparison. Returns false if 82 * no matching header name is found in the message. 83 */ 84 public function hasHeader($header); 85 86 /** 87 * Remove a specific header by case-insensitive name. 88 * 89 * @param string $header Case-insensitive header name. 90 */ 91 public function removeHeader($header); 92 93 /** 94 * Appends a header value to any existing values associated with the 95 * given header name. 96 * 97 * @param string $header Header name to add 98 * @param string $value Value of the header 99 */ 100 public function addHeader($header, $value); 101 102 /** 103 * Merges in an associative array of headers. 104 * 105 * Each array key MUST be a string representing the case-insensitive name 106 * of a header. Each value MUST be either a string or an array of strings. 107 * For each value, the value is appended to any existing header of the same 108 * name, or, if a header does not already exist by the given name, then the 109 * header is added. 110 * 111 * @param array $headers Associative array of headers to add to the message 112 */ 113 public function addHeaders(array $headers); 114 115 /** 116 * Sets a header, replacing any existing values of any headers with the 117 * same case-insensitive name. 118 * 119 * The header values MUST be a string or an array of strings. 120 * 121 * @param string $header Header name 122 * @param string|array $value Header value(s) 123 */ 124 public function setHeader($header, $value); 125 126 /** 127 * Sets headers, replacing any headers that have already been set on the 128 * message. 129 * 130 * The array keys MUST be a string. The array values must be either a 131 * string or an array of strings. 132 * 133 * @param array $headers Headers to set. 134 */ 135 public function setHeaders(array $headers); 136 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |