uses curl to check for http code