The sheriff or other officer executing a capias ad respondendum shall, at the time of the arrest or at any time thereafter before judgment in the action, if requested so to do, produce the defendant before the court in order that he may give bail, and the defendant shall be released from custody upon his entering into a recognizance of bail to the plaintiff, with surety, in double the sum in which he is held to bail.
N.J.S. § 2A:15-43