Pluggdapps

Component system. Web framework. And more ...

httpnet – HTTP content negotiation protocol.

Module contents

class pluggdapps.web.httpneg.HTTPNegotiator(pa, *args, **kwargs)[source]

Bases: pluggdapps.plugin.Plugin

Plugin handle server side negotiation. Gather client side negotiable information using following rules,

  • Use accept header from http request. If not available assume that any type of media encoding is acceptable by client.
  • Use accept_charset from http request. If not available assume that any character encoding is acceptable by client.
  • Use accept_encoding from http request. If not available assume identity coding.
  • Use accept_language from http request. If not available assume any language is acceptable by client.

If a configured variant matches any of the combination supported by client, pick that variant and return the same. Otherwise return None.

negotiate(request, variants)[source]

pluggdapps.plugin.ISettings.normalize_settings() interface method.