Message class abstract
Framework\HTTP\Message
Class Message.
Implements:
Framework\HTTP\MessageInterface, Stringable
Defined in libraries/http/src/Message.php
Properties #
- $protocol
- HTTP Message Protocol.
- $url
- HTTP Request URL.
- $method
- HTTP Request Method.
- $statusCode
- HTTP Response Status Code.
- $body
- HTTP Message Body.
- $cookies
- HTTP Message Cookies.
- $headers
- HTTP Message Headers.
- $jsonFlags
- -
$protocol
HTTP Message Protocol.
$url
HTTP Request URL.
$method
HTTP Request Method.
$statusCode
HTTP Response Status Code.
$body
HTTP Message Body.
$cookies
HTTP Message Cookies.
$headers
HTTP Message Headers.
$jsonFlags
Methods #
- __toString()
- -
- getBody()
- Get the Message body.
- getCookie()
- Get a Cookie by name.
- getCookies()
- Get all Cookies.
- getHeader()
- -
- getHeaderLine()
- -
- getHeaderLines()
- -
- getHeaders()
- -
- getJsonFlags()
- Get JSON flags.
- getProtocol()
- Get the HTTP protocol.
- getStartLine()
- Get the Message Start-Line.
- hasCookie()
- Say if the Message has a Cookie.
- hasHeader()
- -
- parseQualityValues()
- -
- setJsonFlags()
- Set JSON flags.
- appendHeader()
- Append a Message header.
- getMethod()
- Gets the HTTP Request Method.
- getStatusCode()
- Get the status code.
- getUrl()
- Gets the requested URL.
- isMethod()
- -
- isStatusCode()
- -
- parseContentType()
- -
- removeCookie()
- Remove a Cookie by name.
- removeCookies()
- Remove many Cookies by names.
- removeHeader()
- Remove a header by name.
- removeHeaders()
- Remove all headers.
- removeHeadersByNames()
- Remove headers by names.
- setBody()
- Set the Message body.
- setCookie()
- Set a new Cookie.
- setCookies()
- Set a list of Cookies.
- setHeader()
- Set a Message header.
- setHeaders()
- Set a list of headers.
- setMethod()
- Set the request method.
- setProtocol()
- Set the HTTP protocol.
- setStatusCode()
- -
- setUrl()
- Set the Message URL.
- getHeaderValueSeparator()
- -
__toString()
getBody()
Get the Message body.
getCookie()
Get a Cookie by name.
- string $name
getCookies()
Get all Cookies.
getHeader()
- string $name
getHeaderLine()
- string $name
getHeaderLines()
getHeaders()
getJsonFlags()
Get JSON flags.
getProtocol()
Get the HTTP protocol.
getStartLine()
Get the Message Start-Line.
hasCookie()
Say if the Message has a Cookie.
- string $name - Cookie name
hasHeader()
- string $name
- ?string $value
parseQualityValues()
- ?string $string
setJsonFlags()
Set JSON flags.
- int $flags
appendHeader()
Append a Message header.
Used to set repeated header field names.
- string $name
- string $value
getMethod()
Gets the HTTP Request Method.
getStatusCode()
Get the status code.
getUrl()
Gets the requested URL.
isMethod()
- string $method
isStatusCode()
- int $code
parseContentType()
removeCookie()
Remove a Cookie by name.
- string $name
removeCookies()
Remove many Cookies by names.
- array $names
removeHeader()
Remove a header by name.
- string $name
removeHeaders()
Remove all headers.
removeHeadersByNames()
Remove headers by names.
- array $names
setBody()
Set the Message body.
- string $body
setCookie()
Set a new Cookie.
- \Framework\HTTP\Cookie $cookie
setCookies()
Set a list of Cookies.
- array $cookies
setHeader()
Set a Message header.
- string $name
- string $value
setHeaders()
Set a list of headers.
- array $headers
setMethod()
Set the request method.
- string $method - One of: CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, or TRACE
setProtocol()
Set the HTTP protocol.
- string $protocol - HTTP/1.1, HTTP/2, etc
setStatusCode()
- int $code
setUrl()
Set the Message URL.
- \Framework\HTTP\URL|string $url
getHeaderValueSeparator()
- string $headerName