When instansiating the AutoMarshalling client it uses the serialize_format to set the Content-Type but ignores the deserialize_format in terms of the Accept header requiring users to set it __init__ is called or serialization will fail.(unless the api defaults to the type the user sent in deserialize_format.
class AutoMarshallingHTTPClient(HTTPClient):
"""@TODO: Turn serialization and deserialization into decorators so
that we can support serialization and deserialization on a per-method
basis"""
def __init__(self, serialize_format=None, deserialize_format=None): super(AutoMarshallingHTTPClient, self).__init__() self.serialize_format = serialize_format self.deserialize_format = deserialize_format or self.serialize_format self.default_headers = {'Content-Type': 'application/{format}'.format( format=serialize_format)}
When instansiating the AutoMarshalling client it uses the serialize_format to set the Content-Type but ignores the deserialize_format in terms of the Accept header requiring users to set it __init__ is called or serialization will fail.(unless the api defaults to the type the user sent in deserialize_format.
class AutoMarshalling HTTPClient( HTTPClient) : format= None, deserialize_ format= None):
super( AutoMarshalling HTTPClient, self).__init__()
self.serialize _format = serialize_format
self.deseriali ze_format = deserialize_format or self.serialize_ format
self.default_ headers = {'Content-Type': 'application/ {format} '.format(
format= serialize_ format) }
"""@TODO: Turn serialization and deserialization into decorators so
that we can support serialization and deserialization on a per-method
basis"""
def __init__(self, serialize_