I am making get/Post request on a URL and in response getting an HTML page. I only want a response header, no response body. already used HEAD method but it is not working in all kind of situations. By getting complete HTML page in response, bandwidth is increasing. and also need a solution so it will work in both https and HTTP request.
For Example
import urllib2
urllib2.urlopen('http://www.google.com')
if I am sending a request on this URL using urllib2 or request. I am getting both response body and header from the server. this request is taking 14.08 kb in bytes. If I break this, the response header is taking 775 bytes and response body is taking 13.32kb. so I need only response header and will save 13.32 kb