21-27-1. Right of person detained or imprisoned to apply for writ. Any person committed or detained, imprisoned or restrained of his liberty, under any color or pretense whatever, civil or criminal, except as provided herein, may apply to the Supreme or circuit court, or any justice or judge thereof, for a writ of habeas corpus.
Source: CCrimP 1877, §§ 671, 672; CL 1887, §§ 7839, 7840; RCCrimP 1903, §§ 771, 772; RC 1919, §§ 4978, 4979; SDC 1939 & Supp 1960, § 37.5501; SL 1983, ch 169, § 1.