When a person is detained for a non-bailable offence, he cannot demand to be released on bail as a matter of right. He can, however, request the court to grant bail. The provisions in this case are governed by Section 437/
Section 437 - When any person accused of, or suspected of, the commission of any non-bailable offence is arrested or detained without warrant by an officer-in-charge of a police station or appears or is brought before a Court other than the High Court or Court of session, he may be released on bail. If it appears to such officer or Court at any stage of the investigation, inquiry or trial, as the case may be, that there are no reasonable grounds for believing that the accused has committed a non-bailable offence, but there are sufficient grounds for further inquiry into his guilt, the accused shall be released on bail, or, at the discretion of such officer or Court, on the execution by him of a bond without sureties for his appearance. A police officer or the court may also release a person from custody if he feels that there are any special reasons. But he must record his reasons in writing.