The Writ of Habeas Corpus demands that requires a prisoner must go before the court to determine if there is lawful authority to detain the prisoner. Criminal habeas corpus writs are procedures used to test the legality and correctness of a prisoner's detention.A writ of habeas corpus is used to bring a prisoner or other detainee (e.g. The amended petition must be written on the courtapproved petition for writ of habeas corpus form. When a response is ordered to an application for a Writ of Habeas Corpus or for any other form of relief, the response shall be filed within five (5) days. 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. 2 It is most often invoked after conviction and the exhaustion of the ordinary means of appeal. 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. Put simply, it means that if you are arrested, you have the right to make the government prove to a judge that your arrest and detainment are justified.