A writ of habeas corpus requires that a person who is in custody be brought before a judge or court and that they be able to challenge that custody. The writ of habeas corpus is a legal order requiring a person holding another person to produce that individual before a court or judge.Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. This Chapter explains an important right—the writ of habeas corpus. A petition for writ of habeas corpus may be filed with a superior court judge or with either appellate court under N.C.G.S. § 17-6. Any prisoner, or another person acting on their behalf, may petition the court, or a judge, for a writ of habeas corpus. 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 privilege of the writ of habeas corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it. Latin for "You have the body. Historically, habeas corpus was provided as a means to challenge unlawful imprisonment.