(1) The name or description of the person whose liberty is restrained;
(2) The person restraining, the mode of restraint, and the place of detention as nearly as practicable;
(3) The cause or pretense of the restraint. If the restraint is under the pretext of legal process, a copy of the process must be annexed to the petition if this is within the power of the applicant;
(4) A distinct averment of the alleged illegality in the restraint or of any other reason why the writ of habeas corpus is sought; and
(5) A prayer for the writ of habeas corpus.