Application for the writ shall be made by verified petition, signed either by the party for whose relief it is intended or by some person in his behalf, and shall state that the person in whose behalf the writ is applied for is imprisoned or restrained of his liberty, the place where, and the officer or person by whom he is so confined or restrained, naming all the parties, if they are known, or describing them if they are not known. If the imprisonment is alleged to be illegal, the petition shall also state the particulars of the alleged illegality.
A.R.S. § 13-4122