api-client icon indicating copy to clipboard operation
api-client copied to clipboard

Provide a way to override the default request timeout

Open dgulinobw opened this issue 3 years ago • 0 comments

Example usage:

class DogClient(APIClient):
    def __init__(self, 
                 base_url,
                 apikey=""
                 ):
        authentication_method=HeaderAuthentication(
            token=apikey,
            parameter="apikey",
            scheme=None
            )
        super().__init__(authentication_method=authentication_method,
                       response_handler=JsonResponseHandler,
                       request_formatter=JsonRequestFormatter)
        self.authentication_method = authentication_method
        self.apikey = apikey
        self.endpoint = self.Endpoint(base_url=base_url)
        self.set_request_timeout(30.0)

code: https://github.com/relaypro-open/dog_api_python/blob/abf88bf448f085e1cf4ad8fb2407384bf9c5fa61/src/dog/api.py

dgulinobw avatar Feb 02 '23 18:02 dgulinobw