AutoMarshallingHTTPClient __init__ bug
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenCafe |
New
|
Undecided
|
Unassigned |
Bug Description
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. Also it is possible to have a content_type that does not match the format used by the client.
Other known problems.
Since default_headers is not a CaseInsensitive
class AutoMarshalling
"""@TODO: Turn serialization and deserialization into decorators so
that we can support serialization and deserialization on a per-method
basis"""
def __init__(self, serialize_
Proposed solutions:
1.
Remove editing default_headers from client
Making all users set the content-type and accept headers.
2.
Add Accept header to default headers
Expect users to make overrides for special cases ie. application/
3. Add a headers override in the init
description: | updated |