diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-10 00:04:24 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-01-10 00:04:24 +0100 |
commit | c654f31efc548957f10e3f4c1a5060dcea1dcdec (patch) | |
tree | f7dbbe4d6015d4310a09761a73d7c4402dce0868 /module/network | |
parent | updated docs (diff) | |
download | pyload-c654f31efc548957f10e3f4c1a5060dcea1dcdec.tar.xz |
changed HEAD request
Diffstat (limited to 'module/network')
-rw-r--r-- | module/network/HTTPRequest.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py index cd13dd01f..8d65b025f 100644 --- a/module/network/HTTPRequest.py +++ b/module/network/HTTPRequest.py @@ -193,11 +193,19 @@ class HTTPRequest(): if just_header: self.c.setopt(pycurl.FOLLOWLOCATION, 0) self.c.setopt(pycurl.NOBODY, 1) + + # overwrite HEAD request, we want a common request type + if post: + self.c.setopt(pycurl.CUSTOMREQUEST, "POST") + else: + self.c.setopt(pycurl.CUSTOMREQUEST, "GET") + self.c.perform() rep = self.header self.c.setopt(pycurl.FOLLOWLOCATION, 1) self.c.setopt(pycurl.NOBODY, 0) + self.c.setopt(pycurl.CUSTOMREQUEST, 0) else: self.c.perform() |