HasHeaders
trait HasHeaders
Properties
| protected ArrayRepository|null | $headerRepository | The request headers. |
Methods
Get the request headers.
Determine if the request contains the given header.
Add headers to the request.
Add a header to the request.
Replace matching headers on the request.
Specify the request content type.
Indicate that JSON should be returned by the server.
Indicate the type of content that should be returned by the server.
Specify the request user agent.
Resolve the default request headers.
Get the request header repository.
Details
at line 21
array
headers()
Get the request headers.
at line 29
bool
hasHeader(string $name)
Determine if the request contains the given header.
at line 46
HasHeaders
withHeaders(array $headers)
Add headers to the request.
at line 58
HasHeaders
withHeader(string $name, mixed $value)
Add a header to the request.
at line 69
HasHeaders
replaceHeaders(array $headers)
Replace matching headers on the request.
at line 97
HasHeaders
contentType(string $contentType)
Specify the request content type.
at line 107
HasHeaders
acceptJson()
Indicate that JSON should be returned by the server.
at line 117
HasHeaders
accept(string $contentType)
Indicate the type of content that should be returned by the server.
at line 127
HasHeaders
withUserAgent(bool|string $userAgent)
Specify the request user agent.
at line 137
protected array
defaultHeaders()
Resolve the default request headers.
at line 145
protected ArrayRepository
headerRepository()
Get the request header repository.