The motion used to file is called a Writ of Habeas Corpus, and it is most frequently used to ensure that a person's commitment or arrest falls within the laws. The term "habeas corpus" is generally used in criminal proceedings to test the legality of a prisoner's detention.A writ of habeas corpus is a legal rule that gives a prisoner the right to request court assistance and show that they've been wrongfully imprisoned. It is sometimes used to test the legalities of an arrest or a commitment. Article 26 - HABEAS CORPUS Section 13-4121 - Prosecution of writ Section 13-4122 - Application for writ Section 13-4123 - Granting of writ; remand of prisoner. This Chapter explains an important right—the writ of habeas corpus. Use this form when you believe you have been wrongfully confined or wish to appeal a prior conviction. This petition, called a writ of Habeas Corpus, is filed in Federal Court (US District Court ) whether you are serving time in a federal or state prison. In the 20th century, the writ of habeas corpus continued to be used to protect the rights of individuals against arbitrary detention and abuse of power. Special Writs, Orders to Show Cause, and Habeas Corpus.