|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hello there
I have been trying to write a Python script which would access a CGI script on a https server behind a proxy, and I am getting nowhere. First, the setup: There is a proxy, where you get when entering an URL like (domainnames changed): URL (no login required) The server I'd like to access is: URL resp. the cgi script URL (login required for both) To access this server I wrote a script called query.py: a) using urllib.urlopen('www.myproxy.com/server/cgi-gin/server.py'): urlopen asks me for a username and a password and I can read the output of the cgi script. The problem is: I can not POST any arguments within this urlopen command (I usually have several fields and upload files as arguments, using cgi.FieldStorage() containing fields with 3 entries (name, filename, content of file)). b) using urllib2.urlopen and ProxyHandler and HTTPBasicAuthHandler: apart from the fact, that I don't really know what I am doing, it doesn't work. c) using httplib.HTTP(host): this worked perfectly, as long as the cgi was on a http server. When changing to https, the script doesn't work anymore (even if using httplib.HTTPS()). Is there an easy way of doing this? I would prefer something like a) with a working POST, or a c) with a login prompt like in a). Thanks for any help. Bruno Last edited by nyffeler : April 22nd, 2004 at 03:48 AM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > CGI with Python (on proxy with HTTPS) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|