You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
If we're doing a wish list for being warned when you put it in the wrong place, I'd like warnings for unknown keys in \%options in $http->request($method, $url, \%options);, just to save a hypothetical developer 90 minutes trying to figure out why their If-Modified-Since header doesn't seem to be going anywhere...
request
(andget
,post
, etc) accepts an option calledheaders
. Its return hashref also includes a key calledheaders
.But the constructor accepts an option called
default_headers
. I accidentally usedheaders
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 justheaders
. Either way.The text was updated successfully, but these errors were encountered: