Contact an award-winning Writ of Habeas Corpus lawyer today. The first is that you must file your petition within one year of exhausting your direct appeal.To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. A writ of habeas corpus is a judicial mandate to a prison official, usually the warden, ordering that an inmate be brought to the court. 3. Other ways of attacking your conviction include filing an appeal, or a state or federal writ of habeas corpus. A Habeas Corpus Writ is filed with a federal court once the defendant's state appellate remedies have been exhausted. Normally exhaust available state judicial remedies before a federal court will entertain his petition for habeas corpus."). § 2241 provides the same statutory right to habeas corpus relief for challenges in federal court to state court proceedings. The law in the area is an intricate weave of statute and case law.