payload

Module Contents

Classes

LookupError()
Order()
payload_type(self,type)
PayloadRegistry(self) Payload registry.
Payload(self,value,**kwargs)
BytesPayload(self,value,*args,**kwargs)
StringPayload(self,value,*args,**kwargs)
StringIOPayload(self,value,*args,**kwargs)
IOBasePayload(self,value,disposition=”attachment”,*args,**kwargs)
TextIOPayload(self,value,*args,**kwargs)
BytesIOPayload()
BufferedReaderPayload()
JsonPayload(self,value,encoding=”utf-8”,content_type=”application/json”,dumps=None,*args,**kwargs)
AsyncIterablePayload(self,value,*args,**kwargs)
StreamReaderPayload(self,value,*args,**kwargs)

Functions

get_payload(data,*args,**kwargs)
register_payload(factory,type)
class LookupError
class Order
get_payload(data, *args, **kwargs)
register_payload(factory, type)
class payload_type(type)
__init__(type)
__call__(factory)
class PayloadRegistry

Payload registry.

note: we need zope.interface for more efficient adapter search

__init__()
get(data, *args, **kwargs)
register(factory, type)
class Payload(value, **kwargs)
__init__(value, **kwargs)
size()

Size of the payload.

filename()

Filename of the payload.

headers()

Custom item headers

encoding()

Payload encoding

content_type()

Content type

set_content_disposition(disptype, quote_fields=True, **params)

Sets Content-Disposition header.

write(writer)

Write payload.

writer is an AbstractStreamWriter instance:

class BytesPayload(value, *args, **kwargs)
__init__(value, *args, **kwargs)
write(writer)
class StringPayload(value, *args, **kwargs)
__init__(value, *args, **kwargs)
class StringIOPayload(value, *args, **kwargs)
__init__(value, *args, **kwargs)
class IOBasePayload(value, disposition="attachment", *args, **kwargs)
__init__(value, disposition="attachment", *args, **kwargs)
write(writer)
class TextIOPayload(value, *args, **kwargs)
__init__(value, *args, **kwargs)
size()
write(writer)
class BytesIOPayload
size()
class BufferedReaderPayload
size()
class JsonPayload(value, encoding="utf-8", content_type="application/json", dumps=None, *args, **kwargs)
__init__(value, encoding="utf-8", content_type="application/json", dumps=None, *args, **kwargs)
class AsyncIterablePayload(value, *args, **kwargs)
__init__(value, *args, **kwargs)
write(writer)
class StreamReaderPayload(value, *args, **kwargs)
__init__(value, *args, **kwargs)