Comment 4 for bug 930359

Revision history for this message
Duncan McGreggor (oubiwann) wrote : Re: [Bug 930359] Re: Better support for parameterizing standard HTTP headers in s3 apis

On Sat, Feb 11, 2012 at 11:52 AM, Drew Smathers
<email address hidden> wrote:
>
> I would like to suggest we change the API to take "headers" argument
> instead of piecemeal.

My thinking as well.

> If you have other thoughts, let me know. For
> backwards compat we could deprecate usage of "content_type" keyword args
> etc and do deprecation warnings.
>
> If we do decide to use headers keyword arg, my next questions are:
>
> 1. Should we require Headers object from twisted?
> 2. Plain dict?

That's what my gut tells me...

> 3. Either and do type checking to coerce to Headers if dict?

Yeah, that might be a ways to go...

Currently the headers are set in a couple locations:

1) txaws.ec2.client.Query.submit (built in local scope, ultimately
sent to getPage in kwargs)
2) txaws.s3.client.S3Client (amz_headers in various S3Client methods
and Query methods)

It would be nice if we could define a sane and unified mechanism for
setting headers across the entire library, generalizing in
txaws.client.base and extending/modifying as necessary in subclasses.

> Note that eventually we have to coerce to the Headers object to use with
> Agent API so far as I know.

/me nods

Good to know -- thanks!