diff options
Diffstat (limited to 'module/network')
-rw-r--r-- | module/network/HTTPRequest.py | 6 | ||||
-rw-r--r-- | module/network/RequestFactory.py | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py index cc1a05852..bf23bb202 100644 --- a/module/network/HTTPRequest.py +++ b/module/network/HTTPRequest.py @@ -154,7 +154,7 @@ class HTTPRequest(): self.getCookies() - def load(self, url, get={}, post={}, referer=True, cookies=True, just_header=False, multipart=False): + def load(self, url, get={}, post={}, referer=True, cookies=True, just_header=False, multipart=False, decode=False): """ load and returns a given page """ self.setRequestContext(url, get, post, referer, cookies, multipart) @@ -180,7 +180,9 @@ class HTTPRequest(): self.lastEffectiveURL = self.c.getinfo(pycurl.EFFECTIVE_URL) self.addCookies() - #rep = self.decodeResponse(rep) + if decode: + rep = self.decodeResponse(rep) + return rep def verifyHeader(self): diff --git a/module/network/RequestFactory.py b/module/network/RequestFactory.py index 9b32ed570..44f66efab 100644 --- a/module/network/RequestFactory.py +++ b/module/network/RequestFactory.py @@ -58,9 +58,10 @@ class RequestFactory(): """ returns a http request, dont forget to close it ! """ return HTTPRequest(CookieJar(None), self.getOptions()) - def getURL(self, url, get={}, post={}, multipart=False): + def getURL(self, *args, **kwargs): + """ see HTTPRequest for argument list """ h = HTTPRequest(None, self.getOptions()) - rep = h.load(url, get, post, multipart=multipart) + rep = h.load(*args, **kwargs) h.close() return rep |