The writ must be directed to the person having custody of or restraining the person on whose behalf the application is made, and must command that person to have the person in custody or restraint personally appear before the court before whom the writ is returnable, at a place therein specified, immediately or at some specified time, regard being had to the circumstances and the distance to be traveled.
N.D.C.C. § 32-22-07