replace file_get_contents with curl