Might be worth examining what Requests does here. =)