The procedure for filing a petition for a writ of habeas corpus is spelled out in the CPLR Article 70. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment.Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights. In New York, the Writ of Habeas Corpus plays a crucial role in protecting the rights of individuals who are unlawfully detained or imprisoned. A writ of habeas corpus requires that a person who is in custody be brought before a judge or court and that they be able to challenge that custody. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. This article addresses a defendant's right to file a federal petition for a writ of habeas corpus from a conviction in a state court. What is habeas corpus for dummies? This article addresses a defendant's right to file a federal petition for a writ of habeas corpus from a conviction in a state court. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment.