Skip to content

Commit 9de2f55

Browse files
authored
Merge pull request #213 from maxmind/horgh/sandbox
Document using the sandbox
2 parents 543732f + 897983d commit 9de2f55

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ If the record is not found, a `\GeoIp2\Exception\AddressNotFoundException`
107107
is thrown. If the database is invalid or corrupt, a
108108
`\MaxMind\Db\InvalidDatabaseException` will be thrown.
109109

110-
See the API documentation for more details.
110+
See the [API documentation](https://maxmind.github.io/GeoIP2-php/) for more
111+
details.
111112

112113
### City Example ###
113114

@@ -293,6 +294,13 @@ service:
293294
$client = new Client(42, 'abcdef123456', ['en'], ['host' => 'geolite.info']);
294295
```
295296

297+
To call the Sandbox GeoIP2 web service instead of the production GeoIP2 web
298+
service:
299+
300+
```php
301+
$client = new Client(42, 'abcdef123456', ['en'], ['host' => 'sandbox.maxmind.com']);
302+
```
303+
296304
After creating the client, you may now call the method corresponding to a
297305
specific endpoint with the IP address to look up, e.g.:
298306

@@ -306,7 +314,8 @@ of which represents part of the data returned by the web service.
306314

307315
If there is an error, a structured exception is thrown.
308316

309-
See the API documentation for more details.
317+
See the [API documentation](https://maxmind.github.io/GeoIP2-php/) for more
318+
details.
310319

311320
### Example ###
312321

@@ -319,7 +328,9 @@ use GeoIp2\WebService\Client;
319328
// Replace "42" with your account ID and "license_key" with your license
320329
// key. Set the "host" to "geolite.info" in the fourth argument options
321330
// array to use the GeoLite2 web service instead of the GeoIP2 web
322-
// service.
331+
// service. Set the "host" to "sandbox.maxmind.com" in the fourth argument
332+
// options array to use the Sandbox GeoIP2 web service instead of the
333+
// production GeoIP2 web service.
323334
$client = new Client(42, 'abcdef123456');
324335

325336
// Replace "city" with the method corresponding to the web service that

src/WebService/Client.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ class Client implements ProviderInterface
6868
* * `host` - The host to use when querying the web
6969
* service. To query the GeoLite2 web service
7070
* instead of the GeoIP2 web service, set the
71-
* host to `geolite.info`.
71+
* host to `geolite.info`. To query the Sandbox
72+
* GeoIP2 web service instead of the production
73+
* GeoIP2 web service, set the host to
74+
* `sandbox.maxmind.com`. The sandbox allows you to
75+
* experiment with the API without affecting your
76+
* production data.
7277
* * `timeout` - Timeout in seconds.
7378
* * `connectTimeout` - Initial connection timeout in seconds.
7479
* * `proxy` - The HTTP proxy to use. May include a schema, port,

0 commit comments

Comments
 (0)