The person alleged to have such party under illegal confinement or restraint may make return to such warrant, as in case of a writ of habeas corpus, and the same may be denied, and like allegations, proofs, and trial thereupon may be had as upon a return to a writ of habeas corpus.
N.D.C.C. § 32-22-31