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.
Remove a header from the request.
Remove the given headers from 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
withoutHeader(string $name)
Remove a header from the request.
at line 108
HasHeaders
withoutHeaders(array $names)
Remove the given headers from the request.
at line 126
HasHeaders
contentType(string $contentType)
Specify the request content type.
at line 136
HasHeaders
acceptJson()
Indicate that JSON should be returned by the server.
at line 146
HasHeaders
accept(string $contentType)
Indicate the type of content that should be returned by the server.
at line 156
HasHeaders
withUserAgent(bool|string $userAgent)
Specify the request user agent.
at line 166
protected array
defaultHeaders()
Resolve the default request headers.
at line 174
protected ArrayRepository
headerRepository()
Get the request header repository.