It tests the legality of a detention or a restraint and the goal is to use it really almost i guess it's an emergency basis. The writ of habeas corpus is used to attack an unlawful detention or illegal imprisonment.A habeas petition proceeds as a civil action against the State agent (usually a warden) who holds the defendant in custody. This Chapter discusses how the writ of habeas corpus is applied in three states: Florida, New York, and. Michigan. 2005 Florida Code - CIVIL PRACTICE AND PROCEDURE HABEAS CORPUSChapter 79. Exhaustion means that you have to give the state court the chance to hear all of the claims you will raise in your habeas petition first. If you did not raise a. The purpose of this order is to ensure that the detainee is not being held unlawfully or without sufficient cause. 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. —The writ of habeas corpus shall be grantable of right, freely and without cost.