We might consider using the `requests` library in the future; much nicer to use and read. Here I see you're probably just moving this code from somewhere else.