MediaWiki  1.30.0
Wikimedia\Http Namespace Reference

Utility for negotiating a value from a set of supported values using a preference list. More...

Classes

class  HttpAcceptNegotiator
 
class  HttpAcceptParser
 

Detailed Description

Utility for negotiating a value from a set of supported values using a preference list.

Utility for parsing a HTTP Accept header value into a weight map.

This is intended for use with HTTP headers like Accept, Accept-Language, Accept-Encoding, etc. See RFC 2616 section 14 for details.

To use this with a request header, first parse the header value into an array of weights using HttpAcceptParser, then call getBestSupportedKey.

Note
GPL-2.0+
Author
Daniel Kinzler
Thiemo Mättig

May also be used with other, similar headers like Accept-Language, Accept-Encoding, etc.

Note
GPL-2.0+
Author
Daniel Kinzler