A habeas corpus petition is used to argue that a person is being unlawfully held in custody, and should be released. Habeas corpus is a collateral attack on a judgment of imprisonment and is not a substitute for appeal.In the field shown, click on Petition for Writ of Habeas Corpus, then click on Next. 22. The case number should appear. Application And Writ Of Habeas Corpus Ad Prosequendum PDF, 204 KB. These files may not be suitable for users of assistive technology. Use this form to obtain the presence of a witness in a civil or criminal case. FindLaw Codes may not reflect the most recent version of the law in your jurisdiction. North Carolina, 397 U.S. 790 (1970); McMann v. Article 1 - Constitutional Provisions. The writ of habeas corpus serves the purpose of safeguarding personal freedoms against lawless government actions.