A function to get a files contents with curl.