Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for LWP user agents #11

Closed
mtmail opened this issue Jun 15, 2021 · 1 comment · Fixed by #13
Closed

add support for LWP user agents #11

mtmail opened this issue Jun 15, 2021 · 1 comment · Fixed by #13

Comments

@mtmail
Copy link
Member

mtmail commented Jun 15, 2021

Geo::Coder::OpenCage allows to set a user agent (ua parameter) which defaults to HTTP::Tiny. Documentation says "Useful if for example you want to specify that something like LWP::UserAgent::Throttled for rate limiting."

Later in code logic

my $response = $self->{ua}->get($URL);`
...
$response->{reason}
...
$response->{content}

That fits the HTTP::Tiny interface.

But the more common LWP user agents as well, e.g. LWP::Simple or LWP::UserAgent::Throttled return a HTTP::Response instance with status_line and decoded_content data accessors.

@freyfogle
Copy link
Member

probably the easiest thing here is just to change the documentation ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants