Because the purpose of the petition is to gain the release of an unlawfully detained person, the reasons that justify the writ are narrowly defined. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment.Instructions: This affidavit must be used for service of a Summons and. Petition for a Writ of Habeas Corpus Under 28 U.S.C. § 2241. Download. Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights. A writ of habeas corpus is a judicial mandate to a prison official, usually the warden, ordering that an inmate be brought to the court. If you want to challenge your immigration detention or other immigration related issues, you should use the form Petition for a Writ of Habeas Corpus under 28. Thus, rather than examining a case for legal error, a habeas corpus proceeding examines whether any constitutional violations occurred at trial or sentencing. The writ of habeas corpus primarily acts as a writ of inquiry, issued to test the reasons or grounds for restraint and detention. Accompanying papers; or, for writ of habeas corpus process.