The procedure for filing a petition for a writ of habeas corpus is spelled out in the CPLR Article 70. Petition for a Writ of Habeas Corpus under 28 USC 2241.Category Representing Yourself (Pro Se). Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights. 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. Clients also include inmates incarcerated at the County's two State Correctional facilities who file habeas Corpus Petitions in Orleans County Supreme Court. Any defendant who has been convicted of a New York state crime in a proceeding should be aware of their right to file a petition for a Writ of Habeas Corpus. This Chapter discusses how the writ of habeas corpus is applied in three states: Florida, New York, and Michigan. Most Maryland court forms and brochures are available in this index. Such petitions can be filed if a defendant has been convicted in a New York state court as well as for defendants convicted in a federal court.