Skip to content

Commit ed328e6

Browse files
committed
Add request options to README.
1 parent 5fe3218 commit ed328e6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ It's possible to use a custom cache by creating a child class of the [CacheInter
161161
>>> handler = ipinfo.getHandler(cache=my_fancy_custom_class)
162162
```
163163

164+
#### Modifying request options
165+
166+
Request behavior can be modified by setting the `request_options` keyword argument. `request_options` is a dictionary in which the keys are keyword arguments specified in the `requests` library. The nesting of keyword arguments is to prevent name collisions between this library and its dependencies.
167+
168+
* Default request timeout: 2 seconds
169+
170+
```
171+
>>> handler = ipinfo.getHandler(request_options={'timeout': 4})
172+
```
173+
174+
164175
#### Internationalization
165176

166177
When looking up an IP address, the response object includes a `details.country_name` attribute which includes the country name based on American English. It is possible to return the country name in other languages by setting the `countries_file` keyword argument when creating the `IPinfo` object.

0 commit comments

Comments
 (0)