The procedure for filing a petition for a writ of habeas corpus is spelled out in the CPLR Article 70. The writ of habeas corpus primarily acts as a writ of inquiry, issued to test the reasons or grounds for restraint and detention.Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights. When a prisoner files a petition for a writ of habeas corpus, her custodian must explain why the restraint is lawful. It demands a person's release from unlawful detention. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment. It allows the Court to issue a habeas writ, without awaiting any action in a lower court. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. You can file a Writ of Habeas Corpus on your own, and a lot of convicted defendants do try. What is habeas corpus in simple words?