Maxmind geoip lookup
// Replace "42" with your account ID and "license_key" with your license key. The object is closeable, but // it should not be closed until you are finished making requests with it. Reusing the object will allow it to keep // connections alive for future requests. This creates a WebServiceClient object that is thread-safe and can be // reused across requests.
See the API documentation for more details. Resources are promptly returned to the system. Should close the object to ensure the connections are closed and any Once you have finished making requests, you Making multiple requests, the object should be reused so that new connectionsĪre not created for each request. The WebServiceClient object is safe to share across threads. If the request fails, the client class throws an exception. Which represents part of the data returned by the web service. This model in turn contains multiple record classes, each of If the request succeeds, the method call will return a model class for the end The method corresponding to a specific end point, passing it the IP address After you have created the WebServiceClient, you may then call Set a timeout or set the locales fallback order using the methods on theīuilder. Of GeoIP2, set the host method on the builder to. You must provide the Builder constructor your To use the web service API, you must create a new WebServiceClient using the Should not be used to identify a particular address or household. Any location provided by a GeoIP2 database or web service If you are unable to use Maven or Gradle, you may include the geoip2.jarįile and its dependencies in your classpath.