[Yum-devel] [UG] New user Question: Access to headers from urlgrabber.urlread()?

Michael Stenner mstenner at linux.duke.edu
Tue Sep 6 16:56:49 UTC 2005


On Mon, Sep 05, 2005 at 04:58:52PM -0500, William McVey wrote:
> I'm just beginning to use urlgrabber for a project I'm working on and
> although I can get the data of a URL just fine using urlread(), how I
> operate on the results of a URL depends on it's content type returned by
> the web server. Is there a canonical way of gaining access to the
> returned HTTP headers using urlgrabber?

Not when you're using the urlgrab or urlread convenience functions.
Basically, you want to use the urlread function/method and then just
do .read() on the returned file object.  The file object will have a
.hdr attribute which contains the headers.

					-Michael
-- 
  Michael D. Stenner                            mstenner at ece.arizona.edu
  ECE Department, the University of Arizona                 520-626-1619
  1230 E. Speedway Blvd., Tucson, AZ 85721-0104                 ECE 524G



More information about the Yum-devel mailing list