livehelpnow / ex-rackspace

Elixir library for interfacing with Rackspace Cloud API's
5 stars 12 forks source link

Passing headers to Rackspace #5

Open rpless opened 8 years ago

rpless commented 8 years ago

We've been using ex-rackspace to access Cloud Files. Some of the files are fairly large, so we needed to pass the Range header to Rackspace. The library currenly doesn't have a way of passing HTTP headers to Rackspace although several of the API endpoints support them. I've partially (and rather messily imo) patched it here. I was wondering if you'd be interested in a more complete and cleaned up PR that adds HTTP header support. If so I'd like to discuss changing the Rackspace.Api.CloudFiles.Object struct. Right now a number of the return headers are put right into the struct as various fields. My feeling is that it might be better to have a resp_headers field on the struct and let a client to ex-rackspace figure out which ones they cared about. Thoughts?

mobileoverlord commented 8 years ago

@rpless I would love to expand this library out to support adding custom headers. Something I've been trying to get around to is to pull out httpotion and use httpoison so we can get off ibrowse and move to hackney. I would love if you put together a PR for it. I believe that I need to abstract the HTTP lib so it can easily be pulled out in the future.