I am currently making a sharepoint 2013 app on Indian railways, in this app I am accessing railways api which is on HTTP site and my code is on HTTPS site, which is office 365 online site. Since I am making an app on office 365 it is giving me an error, ' Loading mixed (insecure) active content on a secure page "http://pnrbuddy.com/api/station_by_code/code/cnb/format/json/pbapikey/539ff0f815ca697c681fe01d32ba52e3/pbapisign/906544ca31f9c0048e80bde8127556af828e313b" ' , in my browser console what would be the reason?
There are really only two ways that you can overcome this and only one of them is controllable by you.
The bad answer is that each visitor can change a setting in their browser to allow mixed content. That's just not a practical solution. I'd argue it's just bad all the way around.
You will need to use a proxy to get the data for you. You could use the Proxy API available in SharePoint, or you could write a custom proxy service.