Skip to content

Throw an error if someone passes a headers option to the constructor #142

Description

@tobyink

request (and get, post, etc) accepts an option called headers. Its return hashref also includes a key called headers.

But the constructor accepts an option called default_headers. I accidentally used headers and was confused for at least an hour about why the API that I was calling kept returning 403 Forbidden. (Didn't help that it was behind Cloudflare, so I thought they were the ones blocking me.)

It would be nice if HTTP::Tiny->new( headers => \%h ) threw an error or at least a warning. Either the constructor could complain about all unrecognized options, or just headers. Either way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions