The application must be made on the verified petition of the party beneficially interested, and the court may require a notice of the application to be given to the adverse party, or may grant an order to show cause why it should not be allowed, or may grant the writ without notice.