- Add
escape_path
helper - Add Python 3.13 support
- Declare
__all__
not to expose imports - Relax
requests
dependency
- Fix the missing
response
(andrequest
) attributes on theHTTPError
s re-raised inraise_for_response
- Change the default
raise_for_response
implementation to include the response body in the error message if the status is 4xx. This criterion can be changed by overriding the new methodinclude_body_in_exception
. One can also overrideraise_for_response
to completely customize the exceptions raised by the library.
post_json_api
: fix docstring- Add
put_json_api
,patch_json_api
,delete_json_api
- Add
max_retries
to the constructor
- Add
post_json_api
- Add
timeout
to the constructor to specify a default timeout for all requests - Add official support for Python 3.12
- Add
offline
as an equivalent ofread_only
for all methods
- Add
JSONDict
to typedict
s from JSON responses.
- Add
none_on_empty
constructor andget_json_api
optional argument to returnNone
on empty bodies. This is disabled by default so the current behavior doesn’t change.
- Move
api_session.READ_METHODS
toAPISession.READ_METHODS
to make it easier to override - Add
.none_on_404
to set the default for.get_json_api
’s argument of the same name
throw
defaults toNone
instead ofFalse
in all methods. This allows a class that overridesrequest_api
to know if the parameter was set (True
orFalse
) or not (None
).
- Add
.patch_api
method - Support
read_only
in the baserequest()
method as well - Don’t throw if
get_json_api
is called withthrow=True, none_on_404=True
(the default) and encounters a 404 error. This is the documented behavior but the logic wasn’t correctly implemented.
- Fix
user_agent
support
- Add
bypass_read_only
optional parameter torequest_api()
- Add
.head_api()
- This releases moves to 1.x because the library API is stable
- Add
py.typed
to mark the module as PEP-561-compliant
Initial public release.