httpbakery .Client overly restrictive on body - io.ReaderSeeker

Tim Penhey tim.penhey at canonical.com
Wed Mar 9 03:03:01 UTC 2016


Hi folks,

I came across this recently while looking at sending tools and charms
between two controllers.

The local storage interface gives us an io.ReaderCloser. Unfortunately,
we can't give that to the http client for the POST method as it needs an
io.ReaderSeeker.

I'd like to challenge the need for the seek method.

Is there any way we could change the method to take an io.Reader?

Perhaps with a documentation caveat that if it implements
io.ReaderSeeker, that Seek(0,0) will be called.

Right now, I'm going through a local temp file, but I'd rather not have
to if I don't need to.

Tim



More information about the Juju-dev mailing list