Package wtf :: Module httputil :: Class CookieCodecInterface
[hide private]
[frames] | no frames]

Class CookieCodecInterface

source code

object --+
         |
        CookieCodecInterface

Interface for Cookie codecs
Instance Methods [hide private]
str
encode(self, value)
Encode the cookie value to a 7bit US-ASCII string
source code
any
decode(self, value)
Decode the cookie value from 7bit US-ASCII string
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

encode(self, value)

source code 

Encode the cookie value to a 7bit US-ASCII string

This method is also responsible for quoting the value if necessary.

Parameters:
  • value (any) - The value to encode
Returns: str
The encoded value

decode(self, value)

source code 
Decode the cookie value from 7bit US-ASCII string
Parameters:
  • value (str) - The cookie string (as submitted)
Returns: any
The decoded value
Raises:
  • ValueError - The value could not be decoded properly