curl-and-python

How to fully customize the Http request

From: Mohamed Lrhazi <lrhazi_at_gmail.com>
Date: Fri, 19 May 2006 23:48:56 -0400

Hello,

This is not pycurl specific really, but i just happen to be trying
curl from Python.

I need to send a custom HTTP request, PURGE request to Squid proxy
servers. I tried this:

c = pycurl.Curl()
purge_url='http://yahoo.com/index.html'
c.setopt(c.URL, 'http://10.0.4.2/%s'%purge_url)
c.setopt(c.CUSTOMREQUEST,'PURGE')

This CURL sent:

DEBUG: 2 PURGE /http://yaqb.org/test-cache/test.html HTTP/1.1

Notice the slash at the begining of the path part.

How do I go about making it send my url as is?

Thanks a lot.

Mohamed~

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2006-05-20