Contact an award-winning Writ of Habeas Corpus lawyer today. A writ of habeas corpus is a legal proceeding designed to bring a party before a court to test whether they are being held lawfully.A petition for writ of habeas corpus is a legal action that allows individuals to challenge their unlawful imprisonment or restraint. We command you, to have the body of. The writ of habeas corpus primarily acts as a writ of inquiry, issued to test the reasons or grounds for restraint and detention. A Federal Writ of Habeas Corpus is a procedure where federal courts with national power can review the legality of an individual's incarceration. A habeas corpus petition cannot act as a second direct appeal. Prisoners can sometimes use a petition for writ of habeas corpus to challenge the legality of a criminal conviction or inhumane prison conditions.