Because the purpose of the petition is to gain the release of an unlawfully detained person, the reasons that justify the writ are narrowly defined. Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights.The writ of habeas corpus primarily acts as a writ of inquiry, issued to test the reasons or grounds for restraint and detention. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. Petition for a Writ of Habeas Corpus Under 28 U.S.C. § 2241. Download. This Chapter explains an important right—the writ of habeas corpus. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment. As an incarcerated person. The privilege of the writ of habeas corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it.