Ask CURL to disconnect as soon as it receives a header
===

I'm pulling data from a server but need to know the type of data before I pull it. I know I can look at content-type in the response header, and I've looked into using

curl --head http://x.com/y/z

however some servers do not support the "HEAD" command (I get a 501 not implemented response).

Is it possible to somehow do a GET with curl, and immediately disconnect after all headers have been received?