def request(self, path, data=None):
        try:
            import requests
        except ImportError:
            raise CommandError("Posterous importer requires the requests"
                               "library installed")
        data = data or {}
        params = {
            'api_token': self.api_token
        }
        params.update(data)
        url = "http://posterous.com/api/2/%s" % path
        r = requests.get(url,
            data=params,
            auth=(self.username, self.password)
        )
        if r.text.startswith("403"):
            raise CommandError(r.text)
        try:
            response = json.loads(r.text)
            return response
        except:
            raise CommandError(r.text)
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/blog/management/commands/import_posterous.py/Command.request/original