Writs of Habeas Corpus. An application for a Writ of Habeas Corpus is filed when a person seeks relief from unlawful detention or imprisonment.The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. The habeas corpus petition must be typewritten or legibly handwritten. Habeas corpus is a kind of petition that you can file in federal court to claim that your imprisonment violates federal law. Habeas corpus is a remedy for violations of constitutional rights, such as ineffective assistance of counsel. This practice advisory is an introduction to the law of habeas corpus in the immigration context. An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation. 1 (The term "federal law" includes not only federal statutes, but also U.S. treaties and the.