switch for sync / async http io