Application for the writ must be made by petition signed either by the person for whose relief it is intended or by some person in that person's behalf, and must specify:
1. That the person in whose behalf the writ is applied for is imprisoned or restrained of the person's liberty, the officer or person by whom the person is so confined or restrained, and the place where, naming all the parties if they are known, or describing them if they are not known.2. The cause or pretense of such confinement or restraint according to the knowledge or belief of the party verifying the petition.3. If the confinement or restraint is by virtue of any warrant, order, or process, a copy thereof shall be annexed, or it shall be averred because such person was removed or concealed before application, a demand of such copy could not be made, or that such demand was made and the legal fees therefor tendered to the officer or person having such person in custody, and that such copy was refused.4. If the imprisonment is alleged to be illegal, the petition shall state in what the illegality consists.The petition must be verified by the oath or affirmation of the person making the application.