[twill] setting HTTP headers

Shaun Walbridge walbridge at nceas.ucsb.edu
Wed Dec 20 15:28:54 PST 2006

Hi list,

I'm currently using twill to build a basic Campfire API, and am quite 
happy with its cookie and form handling.  I's also like to set http 
headers to my requests, is there an easy way to do this? With urllib2, 
it'd be something like:

import urllib2
headers = {'X-Requested-With' : 'XMLHttpRequest'}
response = opener.open(urllib2.Request(url, data, headers))

Is there any easy way of wrapping twill to do the same thing?


More information about the twill mailing list