You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
302 B
Python

from urllib.parse import urljoin
import requests
from apitesting import BASE_URL
TODOS_URL = urljoin(BASE_URL, 'todos')
def get_todos():
"""Returns a list of JSON todo elements"""
response = requests.get(TODOS_URL)
if response.ok:
return response
else:
return None