Category Representing Yourself (Pro Se). Petition Under 28 U.S.C. § 2254 for a Writ of Habeas Corpus.In this application form: 1. An application for a Writ of Habeas Corpus is filed when a person seeks relief from unlawful detention or imprisonment. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. Petition Under 28 U.S.C. §2254 for Writ of Habeas Corpus By a Person in State Custody. How Do I Fill Out the Form? There is an official form (Judicial Council Form HC-001) for filing a state petition for writ of habeas corpus.