Habeas corpus refers to "a writ employed to bring a person before a court, most frequently to ensure that the person's imprisonment or detention is not illegal. The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty.The state writ of habeas corpus is a legal mechanism that allows individuals to challenge their detention or imprisonment. A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child. (a) A county court may issue a writ of habeas corpus in any case in which the constitution has not conferred the power on the district courts. An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation. Attached are the forms you will need to file a petition for a writ of habeas corpus. It means "you have the body. " In the writ, a judge demands that law enforcement produce a person in their possession. 2. In a writ of habeas corpus, a defendant seeks to establish that his or her prison sentence is illegal.