httr fix

You can test this out and merge when ready. If you don't merge soon, I'll push more changes to this same pull request as I find time. Otherwise I'll create a new PR if you do merge.