curl-library
How to fully customize the HTTP request
From: Mohamed Lrhazi <lrhazi_at_gmail.com>
Date: Sun, 21 May 2006 01:15:16 -0400
Date: Sun, 21 May 2006 01:15:16 -0400
I need to send a custom HTTP request, PURGE request, to a Squid proxy
server. I tried this, using Python:
c = pycurl.Curl()
c.setopt(c.URL, 'http://10.0.0.1/http://yahoo.com/index.html')
c.setopt(c.CUSTOMREQUEST,'PURGE')
10.0.0.1 being my Squid server. This causes cURL to send
PURGE /http://yahoo.com/index.html HTTP/1.1
The leading slash in the above request is my problem. How do why get rid of it?
Mohamed
Received on 2006-05-21