mdref.json config
[mdref/mdref-http] / http / Header / negotiate.md
1 # string http\Header::negotiate(array $supported[, array &$result])
2
3 Negotiate the header's value against a list of supported values in $supported.
4 Negotiation operation is adopted according to the header name, i.e. if the
5 header being negotiated is Accept, then a slash is used as primary type
6 separator, and if the header is Accept-Language respectively, a hyphen is
7 used instead.
8
9 > ***NOTE:***
10 > The first element of $supported serves as a default if no operand matches.
11
12 ## Params:
13
14 * array $supported
15 The list of supported values to negotiate.
16 * Optional array &$result
17 Out parameter recording the negotiation results.
18
19 ## Returns:
20
21 * NULL, if negotiation fails.
22 * string, the closest match negotiated, or the default (first entry of $supported).