프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$headers | array | HTTP headers | |
$protocol | string | The full protocol: HTTP/1.1 | |
$version | string | Specification version number |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_classes | array | Classes used by Message and its subclasses. | |
$_type | string | Content-Type |
메소드 | 설명 | |
---|---|---|
__construct ( array $config = [] ) : void | Constructor. Adds config values to the public properties when a new object is created. | |
body ( mixed $data = null, array $options = [] ) : array | Add data to and compile the HTTP message body, optionally encoding or decoding its parts according to content type. | |
headers ( string | array $key = null, mixed $value = null, boolean $replace = true ) : mixed | Adds, gets or removes one or multiple headers at the same time. | |
type ( string $type = null ) : string | Sets/gets the content type. |
메소드 | 설명 | |
---|---|---|
_decode ( string $body ) : mixed | Decode the body based on the content type | |
_encode ( mixed $body ) : string | Encode the body based on the content type |
public __construct ( array $config = [] ) : void | ||
$config | array | The available configuration options are the following. Further options are inherited from the parent class. - `'protocol'` _string_: Defaults to `null`. - `'version'` _string_: Defaults to `'1.1'`. - `'scheme'` _string_: Overridden and defaulting to `'http'`. - `'headers'` _array_: Defaults to `array()`. |
리턴 | void |
public headers ( string | array $key = null, mixed $value = null, boolean $replace = true ) : mixed | ||
$key | string | array | A header name, a full header line (`' |
$value | mixed | A value to set if `$key` is a string. It can be an array to set multiple headers with the same key. If `null`, returns the value of the header corresponding to `$key`. If `false`, it unsets the header corresponding to `$key`. |
$replace | boolean | Whether to override or add alongside any existing header with the same name. |
리턴 | mixed | When called with just $key provided, the value of a single header or an array
of values in case there is multiple headers with this key.
When calling the method without any arguments, an array of compiled headers in the
form `array(' |
protected array $_classes | ||
리턴 | array |