A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. The Habeas Corpus petition claims the arrest, sentence, or trial violated constitutional law, making imprisonment unlawful.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. A seasoned New York habeas corpus lawyer can guide and represent you in the filing and litigation of a motion for a writ of habeas corpus. The writ of habeas corpus primarily acts as a writ of inquiry, issued to test the reasons or grounds for restraint and detention. To obtain a writ of habeas corpus, you must show the court that you are in custody in violation of the. Constitution or laws of the United States. — Kara Scannell, CNN, 16 Dec. Unlike any other post-conviction legal remedy, the Writ of Habeas Corpus enables you to introduce new evidence, not previously in the record. New York State Writ of Habeas Corpus.