When the application for a writ of habeas corpus is in the nature of a civil action between parties, the law providing for security for costs shall be applicable; and in such cases persons who may produce the body of another, or render other services, may be allowed the same fees as allowed by law to officers for the same services, the costs to be taxed and collected as in other cases.