The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully. A petition for writ of habeas corpus is a legal action that allows individuals to challenge their unlawful imprisonment or restraint.A habeas corpus petition cannot act as a second direct appeal. 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 is a petition filed with the court when a prisoner wishes to contest the legality of his imprisonment. Fill out the attached Petition for Writ of Habeas Corpus. Habeas corpus means demand of body. A writ of habeas corpus is a petition that an individual uses to challenge their conviction or sentence in California. The writ of habeas corpus was used in relation to persons pressganged into the navy, or in disputes over apprenticeship terms. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment.