A person imprisoned or otherwise restrained of his personal liberty, by an officer or other person, except in the cases mentioned in the following section, is entitled of right to a writ of habeas corpus according to the provisions of this chapter.
RSA 534:1
RS 202:1. CS 215:1. GS 224:1. GL 243:1. PS 239:1. PL 350 :1. RL 406:1.