How can I get only the header part of this response? i.e.,
HTTP/1.1 200 OK
Date: Sat, 20 Dec 2008 10:54:25 GMT
Content-Length: 62
Content-Type: text/plain
Cache-control: private
Actual requirement is to get the header part and the response string i.e., HTTP/1.1 200 OK. I am assuming that the first line in the response(header) will always contain the response string. Is my assumption is correct?
If I have to use this, I need to send two requests, one is for getting headers and one is for getting body content. I don’t think that I can do this when working with a page that updates database.
Is there anyway to get header length so that I can get that part from the response.
It is working. But, sometimes, the value of download_content_length is 0.
And for some POST and PUT requests I am getting HTTP/1.1 100 Continue header first and then getting the POST request headers and body. Is there any way that we can avoid this HTTP/1.1 100 Continue in the cURL response?