Simplified helper to support http and https with same function.