curl-and-python

defer downloading the response body when making GET request

From: iMath <2281570025_at_qq.com>
Date: Mon, 15 Dec 2014 15:24:38 +0800

By default, when you make a request, the body of the response is downloaded immediately. You can override this behaviour in Requests module and defer downloading the response body until you access the Response.content attribute with the stream parameter, described here
http://docs.python-requests.org/en/latest/user/advanced/#body-content-workflow
  
I wonder if pycurl can do the same thing.
 
What I want to do here is to get the direct url of a few URLs having redirections ,it would be better if this could be done asynchronously .You may see I could use HEAD to do this, but the server I am sending request to seems doesn't support HEAD, so this seems the only way I can go ,can I use pycurl do the same thing here ?
 
I have no experience in pycurl, as deadline of my project approaches, it would be better to show some code, thanks!!!‍

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2014-12-15