An application for a writ of habeas corpus shall be by written petition addressed to a competent court by the person in custody or by some other person in his behalf. If the custody is by virtue of or under pretext of a court order, a copy of such order shall be annexed to the petition, or the petition shall allege that a copy of it has been demanded and refused. The petition shall further allege:
The application shall conclude with a prayer for the issuance of the writ. It shall be signed by the applicant and be accompanied by an affidavit that the allegations contained in the petition are true to the best of the affiant's information and belief.
La. Cr.P. § 353