<br><br><div class="gmail_quote">On Fri, Aug 26, 2011 at 3:15 PM, Laszlo Nagy <span dir="ltr"><<a href="mailto:gandalf@shopzeus.com">gandalf@shopzeus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2ZCa8v/<u></u>pycurl-7.19.0/egg-dist-tmp-<u></u>DyHFls<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Using curl-config (libcurl 7.12.1)<br>
src/pycurl.c:42:20: Python.h: No such file or directory<br>
src/pycurl.c:43:22: pythread.h: No such file or directory<br>
src/pycurl.c:58:4: #error "Need Python version 2.2 or greater to compile pycurl."<br>
src/pycurl.c:61:4: #error "Need libcurl version 7.19.0 or greater to compile pycurl."<br>
[... Error Clipped]<br>
error: Setup script exited with error: command '/usr/bin/gcc' failed with exit status 1<br>
</blockquote></div>
I'm not familiar with red hat. But looks like this is now a sysadmin problem. I could install pycurl under freebsd and ubuntu too.<br>
<br>
I have some code that might be able to PUT through a proxy for you. Please look at the attached file.<br>
<br>
You can setup a proxy this way:<br>
<br>
import MozzillaEmulator<br>
MozzillaEmulator.DEFAULT_<u></u>PROXIES = {<br>
'http':'<a href="http://user:password@proxy.host.com:3128" target="_blank">http://user:password@<u></u>proxy.host.com:3128</a>',<br>
'https':'<a href="http://user:password@proxy.host.com:3128" target="_blank">http://user:password@<u></u>proxy.host.com:3128</a>',<br>
}<br>
<br>
And here is how you use it:<br>
<br>
dl = MozillaEmulator.<u></u>MozillaEmulator()<br>
put_url = "<a href="http://some_url_to_put_to" target="_blank">http://some_url_to_put_to</a>"<br>
headers = {'Content-Type':'application/<u></u>xml;charset=UTF-8'}<br>
data = open("some_file","rb").read()<br>
response = dl.download(put_url,data,<u></u>headers,put_method=True)<br>
<br>
If you don't set the put_method flag, then it will POST instead. (But in that case, post data must be a valid post data field fields and values.) If you don't give post_data then it will GET. The PUT method was tested without a proxy, and the GET and POST methods were tested with and without proxy.<br>
<br>
Actually I have tried to do PUT through a proxy, but it didn't work. But it was a restriction on the proxy side. (As far as I can recall, the error message came from the proxy server, something about unsupported request?). So it *might* work for you, with the right proxy server that supports PUT requests.<br>
<br>
Also be aware that this version uses urllib2. Although it can use https protocol, it doesn't check the server's certificate.<br>
<font color="#888888"><br>
<br>
</font></blockquote></div><br><div>Mozilla Emulator works like a charm.</div><div>Also managed to install pycurl and the same works too.</div><div><br></div><div>Thanks. :)</div><div><br></div><div><br></div><div>~Shashwat</div>