diff --git a/ox/api.py b/ox/api.py index 141ffec..042d0be 100644 --- a/ox/api.py +++ b/ox/api.py @@ -131,6 +131,12 @@ class API(object): form.add_field('data', json.dumps(data)) return self._json_request(self.url, form) + def get_url(self, url): + request = urllib.request.Request(url, method='GET') + f = self._opener.open(request) + result = f.read() + return result + def save_url(self, url, filename, overwrite=False): chunk_size = 16 * 1024 if not os.path.exists(filename) or overwrite: