Updated curl_post and curl_transfer to support capturing http response headers.
merged origin/master