Accessing APIs
I have noticed an increase in questions where you are required to access an API. The following is a quick primer on how API access works in Python
import requestsresp = requests.get('fake URL')
resp.status # status of the request
resp.json() # body of response as JSON, access it as you would an array/dictionarybody = {'foo': 'bar'}
requests.post('fake URL', json=body) # this sends the JSON to the URLLast updated