We characterize the space of restrictions of real rational functions to certain algebraic Jordan curves in the plane via the Dirichlet-to-Neumann map associated to the domain in the complex plane bounded by the curve and its Bergman kernel. The characterization leads to a partial fractions-like decomposition for such rational functions and new ways to describe such Jordan curves. The multiply connected case is also explored.