Jasper Report Server と通信するための小さなスクリプトを作成していますが、Python で読み取る必要があります。
これは私のRubyスクリプトの一部です:
def get_uuid_and_cookie
    body = ""
    cookie = ""
    puts "FULL URL: #{"#{REPORT_PATH}/reports/#{REPORT_GROUP}/#{REPORT_NAME}"}"
    uri = URI.parse("#{REPORT_PATH}/reports/#{REPORT_GROUP}/#{REPORT_NAME}")
    http = Net::HTTP.new(uri_put.host, uri_put.port)
    http.start do |http|
        req = Net::HTTP::Put.new(uri_put.path + "?RUN_OUTPUT_FORMAT=#{FORMAT}")
        puts "ACESSANDO: #{uri_put.path}?RUN_OUTPUT_FORMAT=#{FORMAT}"
        req.basic_auth(SERVER_USER, SERVER_PASSWORD)
        req.body = build_xml_request
        resp = http.request(req)
        body = resp.body
        puts "COOKIE RECEBIDO: #{resp['Set-Cookie']}"       
        cookie = resp['Set-Cookie']
    end
これは My Python Script の一部です
def get_uuid_and_cookie():
  handle = None
  req = urllib2.Request(REPORT_URI+"reports/"+REPORT_GROUP+"/"+REPORT_NAME+"/")
  base64string = base64.encodestring('%s:%s' % (SERVER_USER, SERVER_PASSWORD))[:-1]
  authheader =  "Basic %s" % base64string
  req.add_header("Authorization", authheader)
  req.get_method = lambda: 'PUT'
  req.data = build_xml_request()
  try:
      handle = urllib2.urlopen(req)
  except IOError, e:
      print "ERROR: "+str(e)
Ruby スクリプトでは、次のように COOKIE を取得できます。
cookie = resp['Set-Cookie']
これをPythonで作成するにはどうすればよいですか?