Habeas Corpus writ is a challengeto the legality of a prisoner'sdetention. Article-32 of ourConstitution provides for writ. A writ of Habeas Corpus is used to bring a prisoner or other detainee before the court to determine if the person's imprisonment or detention is lawful. If the court concludes that the detention was unlawful, then it directs the person to be released immediately.