This argument is required.
Your MaxMind license key. Go to <https://www.maxmind.com/en/my_license_key> to see your MaxMind User ID and license key.
This argument is required.
This is an array reference where each value is a string indicating a locale. This argument will be passed onto record classes to use when their name() methods are called.
The order of the locales is significant. When a record class has multiple names (country, city, etc.), its name() method will look at each element of this array ref and return the first locale for which it has a name.
Note that the only locale which is always present in the GeoIP2 data in en. If you do not include this locale, the name() method may end up returning undef even when the record in question has an English name.
Currently, the valid list of locale codes is:
Passing any other locale code will result in an error.
The default value for this argument is [en].
The hostname to make a request against. This defaults to geoip.maxmind.com. In most cases, you should not need to set this explicitly.
This can actually be any object which supports agent() and request() methods. This method will be called with an HTTP::Request object as its only argument. This method must return an HTTP::Response object.
All of the request methods accept a single argument:
This must be a valid IPv4 or IPv6 address, or the string me. This is the address that you want to look up using the GeoIP2 web service.
If you pass the string me then the web service returns data on the client systems IP address. Note that this is the IP address that the web service sees. If you are using a proxy, the web service will not see the client systems actual IP address.
CW$client->country()This method calls the GeoIP2 Precision: Country end point. It returns a GeoIP2::Model::Country object.
CW$client->city()This method calls the GeoIP2 Precision: City end point. It returns a GeoIP2::Model::City object.
CW$client->insights()This method calls the GeoIP2 Precision: Insights end point. It returns a GeoIP2::Model::Insights object.
This module will set the User-Agent header to include the package name and version of this module (or a subclass if you use one), the package name and version of the user agent object, and the version of Perl.
This is set in order to help us support individual users, as well to determine support policies for dependencies and Perl itself.
For details on the possible errors returned by the web service itself, see <http://dev.maxmind.com/geoip/geoip2/web-services> for the GeoIP2 web service docs.
If the web service returns an explicit error document, this is thrown as a GeoIP2::Error::WebService exception object. If some other sort of error occurs, this is thrown as a GeoIP2::Error::HTTP object. The difference is that the web service error includes an error message and error code delivered by the web service. The latter is thrown when some sort of unanticipated error occurs, such as the web service returning a 500 or an invalid error document.
All of these error classes have an $error->message() method and overload stringification to show that message. This means that if you dont explicitly catch errors they will ultimately be sent to STDERR with some sort of (hopefully) useful error message.
While many of the end points return the same basic records, the attributes which can be populated vary between end points. In addition, while an end point may offer a particular piece of data, MaxMind does not always have every piece of data for any given IP address.
Because of these factors, it is possible for any end point to return a record where some or all of the attributes are unpopulated.
See <http://dev.maxmind.com/geoip/geoip2/web-services> for details on what data each end point may return.
The only piece of data which is always returned is the ip_address key in the GeoIP2::Record::Traits record.
o Dave Rolsky <firstname.lastname@example.org> o Greg Oschwald <email@example.com> o Mark Fowler <firstname.lastname@example.org> o Olaf Alders <email@example.com>
This software is copyright (c) 2013 - 2015 by MaxMind, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|perl v5.20.3||GEOIP2::WEBSERVICE::CLIENT (3)||2015-06-29|