v2.2.4
Housekeeping
- modified file structure to be more aligned with best practices
- deleted old obsolete
setup.pyfile - fixed license section of
README.md(Issue#26) - updated
.gitignorewith common Python template - made
RestApiConnectionclass available in__init__.py - fixed
license_filesinpyproject.toml(it excepts a list, not a dictionary) - fixed version in
about.py
New Feature(s)
Issue#28
-
added constructors to
RestApiClientandRestApiConnectionclasses to support custom HTTP headers (custom_headers)from ultra_rest_client import RestApiClient client = RestApiClient('username', 'password', custom_headers={"foo":"bar", "user-agent":"hello"}) zones = client.get_zones()
Captured header output:
{ "Accept": "application/json", "Authorization": "Bearer redacted", "Content-Type": "application/json", "foo": "bar", "user-agent": "hello", "User-Agent": "udns-python-rest-client-2.2.3" } -
added a public method to
RestApiConnectionwhich allows modification of headers after client has been instantiatedclient.rest_api_connection.set_custom_headers({"boo":"far","user-agent":"goodbye"}) zones = client.get_zones()
Captured header output:
{ "Accept": "application/json", "Authorization": "Bearer redacted", "Content-Type": "application/json", "foo": "bar", "boo": "far", "user-agent": "goodbye", "User-Agent": "udns-python-rest-client-2.2.3" } -
attempting to set the following headers will raise a
ValueErrorContent-TypeAuthorizationAccept
-
updated
README.mdwith example