If you do not consent to a magistrate judge, the case will be randomly assigned to a district judge. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court.The court explained that a party filing a federal habeas corpus petition must exhaust their state court remedies prior to filing the petition. Contact an award-winning Writ of Habeas Corpus lawyer today. Filling out the form. Fill out the attached form and answer each item completely in the space provided. An action for habeas corpus to inquire into the cause of detention of a person may be brought in any court of record except the probate court. This course will primarily focus on the writ as a post-conviction remedy for illegal detentions resulting from flawed state criminal convictions. A Habeas Corpus Petition must be filed in federal court within one (1) year and 90 days after the Michigan Supreme Court's ruling (465 days). This course will primarily focus on the writ as a post-conviction remedy for illegal detentions resulting from flawed state criminal convictions.