@@ -0,0 +1,1442 @@
+from httpclient import HTTPClient%0Afrom http import Request, Response, Url%0Aimport unittest%0Aimport json%0A%0A%0Aclass GitHubClient(object):%0A%0A    def __init__(self, user_agent=None, base_url='https://api.github.com'):%0A        self.base_url = base_url%0A        if user_agent is None:%0A            self._user_agent = HTTPClient()%0A        else:%0A            self._user_agent = user_agent%0A%0A    @property%0A    def user_agent(self):%0A        return self._user_agent%0A%0A    @user_agent.setter%0A    def user_agent(self, user_agent):%0A        self._user_agent = user_agent%0A%0A    def get_user(self, username):%0A        endpoint = Url(self.base_url)%0A        endpoint.path.append('users')%0A        endpoint.path.append(username)%0A        request = Request('GET', endpoint)%0A        response = self.user_agent.request(request)%0A        if response.is_success:%0A            return json.loads(response.content)%0A        else:%0A            raise Exception(response.status_line)%0A%0A%0Adef _cb(request):%0A    response = Response(200, content=json.dumps(%7B'name': 'batman'%7D))%0A    return response%0A%0A%0Aclass Test(unittest.TestCase):%0A%0A    def testName(self):%0A        ua = HTTPClient()%0A        ua.add_handler('request_send', _cb)%0A        client = GitHubClient(user_agent=ua)%0A        res = client.get_user('franckcuny')%0A        self.assertEqual(res%5B'name'%5D, 'batman')%0A%0A%0Aif __name__ == '__main__':%0A#    gh = GitHubClient()%0A#    res = gh.get_user('franckcuny')%0A#    print res%5B'name'%5D%0A    unittest.main()

add a simple exemple using GitHub API