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.A state writ of habeas corpus is a legal document that allows people in state custody to challenge the legality or constitutionality of their detention. What Is Habeas Corpus? A Writ of Habeas Corpus (Latin for "that you have the body") may be filed on behalf of a person who is unlawfully imprisoned. The state writ of habeas corpus is a legal mechanism that allows individuals to challenge their detention or imprisonment. A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child. A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child. § 2255 is not a petition for a writ of habeas corpus, but it has the same effect. Therefore, it is still referred to as a habeas petition. 7.