This survey article contains various aspects of the direct and inverse spectral problem for twodimensional Hamiltonian systems, that is, two dimensional canonical systems of homogeneous differential equations of the form Jy'(x) = -zH(x)y(x); x ∈ [0;L); 0 < L ≤ ∞; z ∈ C; with a real non-negative definite matrix function H ≥ 0 and a signature matrix J, and with a standard boundary condition of the form y1(0+) = 0. Additionally it is assumed that Weyl's limit point case prevails at L. In this case the spectrum of the canonical system is determined by its Titchmarsh-Weyl coefficient Q which is a Nevanlinna function, that is, a function which maps the upper complex half-plane analytically into itself. In this article an outline of the Titchmarsh-Weyl theory for Hamiltonian systems is given and the solution of the direct spectral problem is shown. Moreover, Hamiltonian systems comprehend the class of differential equations of vibrating strings with a non-homogenous mass-distribution function as considered by M.G. Krein. The inverse spectral problem for two{dimensional Hamiltonian systems was solved by L. de Branges by use of his theory of Hilbert spaces of entire functions, showing that each Nevanlinna function is the Titchmarsh-Weyl coefficient of a uniquely determined normed Hamiltonian. More detailed results of this connection for e.g. systems with a semibounded or discrete or finite spectrum are presented, and also some results concerning spectral perturbation, which allow an explicit solution of the inverse spectral problem in many cases.