(a) A defendant arrested may, at any time before judgment, apply on motion to the court in which the action is pending, upon notice to the plaintiff, to vacate the writ of arrest.
(b) If a motion is made upon affidavits or other proofs on the part of the defendant, but not otherwise, the plaintiff may oppose the same by affidavits or other proofs in addition to those upon which the writ was issued. If upon the hearing of such motion it satisfactorily appears that there was not sufficient cause to allow the writ, or other good cause which would entitle the defendant to be discharged on habeas corpus, the same shall be vacated, or in case he has given bail the court may discharge the same or reduce the amount thereof on good cause shown.