Jovian
⭐️
Sign In
In [1]:
from jovian.utils.request import get
In [2]:
BASE_REQUEST = "http://localhost:8080"
In [3]:
REQ_200 = "{}/{}".format(BASE_REQUEST, 200)
REQ_401 = "{}/{}".format(BASE_REQUEST, 401)
REQ_403 = "{}/{}".format(BASE_REQUEST, 403)
In [12]:
response = get(REQ_401)
retrying request...0 retrying request...1
--------------------------------------------------------------------------- ApiError Traceback (most recent call last) <ipython-input-12-1a921eecb62f> in <module>() ----> 1 response = get(REQ_401) ~/workspace/current/jovian/jovian-py/jovian/utils/request.py in _request_wrapper(self, *args, **kwargs) 57 continue 58 ---> 59 raise ApiError( "Api failing, after {} retries: {}".format(NUM_RETRIES, _pretty(response))) 60 61 return _request_wrapper ApiError: Api failing, after 2 retries: (HTTP 401) The token has expired
In [5]:
import jovian
In [8]:
jovian.configure()
[jovian] If you're a jovian-pro user please enter your company's organization ID on Jovian (otherwise leave it blank). Organization ID: [jovian] Please enter your API key ( from https://jvn.io/ ): API Key:········ [jovian] Configuration complete!
In [ ]:
jovian.commit(nb_filename="request wrapper.ipynb")
[jovian] Saving notebook..
[jovian] Please enter your API key ( from https://jvn.io/ ): API Key:········
In [ ]: