InteractsWithContentTypes
trait InteractsWithContentTypes (View source)
Methods
Determine if the request is sending JSON.
Determine if the current request probably expects a JSON response.
Determine if the current request is asking for JSON.
Determines whether the current requests accepts a given content type.
Return the most suitable content type from the given array based on content negotiation.
Determine if the current request accepts any content type.
Determines whether a request accepts JSON.
Determines whether a request accepts HTML.
Determine if the given content types match.
Get the data format expected in the response.
Details
bool
accepts(string|array $contentTypes)
Determines whether the current requests accepts a given content type.
string|null
prefers(string|array $contentTypes)
Return the most suitable content type from the given array based on content negotiation.