An application for a writ of habeas corpus shall be in writing and signed by the applicant or some person on his behalf, setting forth the facts concerning his detention and in whose custody he is detained, and shall be accompanied by a copy of the warrant of commitment or other documentary authority, if any, or by an affidavit that such copy has been demanded of the person in whose custody he is detained and by him refused or not given. The application shall identify any previous applications made pursuant to this chapter, together with the grounds therein asserted.
SDCL 21-27-3