class Request

Request helpers

Methods

static mixed
getContentType(ServerRequestInterface $request, string|null $default = 'text/html')

Return content type

static bool
isJsonContentType(ServerRequestInterface $request)

Return true if content type is json

static bool
isXmlContentType(ServerRequestInterface $request)

Return true if content type is xml

static bool
isHtmlContentType(ServerRequestInterface $request)

Return true if content type is html

static array
parseAcceptHeader(ServerRequestInterface $request)

Parse accept header

static bool
acceptJson(ServerRequestInterface $request)

Return true if request accept json

static bool
acceptXml(ServerRequestInterface $request)

Return true if request accept xml

static string|null
getBrowserName()

Get browser name

Details

at line 24
static mixed getContentType(ServerRequestInterface $request, string|null $default = 'text/html')

Return content type

Parameters

ServerRequestInterface $request
string|null $default

Return Value

mixed

at line 43
static bool isJsonContentType(ServerRequestInterface $request)

Return true if content type is json

Parameters

ServerRequestInterface $request

Return Value

bool

at line 62
static bool isXmlContentType(ServerRequestInterface $request)

Return true if content type is xml

Parameters

ServerRequestInterface $request

Return Value

bool

at line 75
static bool isHtmlContentType(ServerRequestInterface $request)

Return true if content type is html

Parameters

ServerRequestInterface $request

Return Value

bool

at line 88
static array parseAcceptHeader(ServerRequestInterface $request)

Parse accept header

Parameters

ServerRequestInterface $request

Return Value

array

at line 102
static bool acceptJson(ServerRequestInterface $request)

Return true if request accept json

Parameters

ServerRequestInterface $request

Return Value

bool

at line 120
static bool acceptXml(ServerRequestInterface $request)

Return true if request accept xml

Parameters

ServerRequestInterface $request

Return Value

bool

at line 137
static string|null getBrowserName()

Get browser name

Return Value

string|null