A habeas petition has been described as "the best and only sufficient defense of personal freedom. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment.Though subject to different rules, incarcerated people in both state or federal custody may petition for a federal writ of habeas corpus. What Is Habeas Corpus? Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. A Writ of Habeas Corpus literally means bring the body before the court, and therefor the state needs to prove why the detention is proper. This petition, called a writ of Habeas Corpus, is filed in Federal Court (US District Court ) whether you are serving time in a federal or state prison. Motion must be filed in the sentencing court. This means that you can only file a federal habeas petition if you have already lost your state direct appeal and your state post-conviction proceedings. Right to apply for writ of habeas corpus to test legality of arrest made pursuant to extradition proceedings, § 17-13-30.