  I present a new method of deriving the shape of the dark matter (DM) halos of
spiral galaxies. The method relies on the comparison of model predictions with
high spectral and spatial resolution HI observations of the gas layer.
  The potential arising from the {\em total} mass distribution of the galaxy is
used in the calculation of the vertical distribution of the gas. I developed a
new algorithm to calculate the force field of an arbitrary, azimuthally
symmetric, density distribution. This algorithm is used to calculate the forces
due to the radially truncated stellar disk as well as of the flaring gas layer.
  I use a simple two-parameter family of disk-halo models which have
essentially the same observed equatorial rotation curve but different vertical
forces. This mass model is composed of a stellar disk with constant M/L, and a
DM-halo with a given axial ratio. I approximate the radial force due to the
gaseous disk, and iteratively determine the vertical force due to the global
distribution of the gas.
  The thickness of the gaseous disk is sensitive to both the flattening of the
DM-halo and the self-gravity of the gas, but not to the particular choice of
disk-halo decomposition.
  I show that the determination of the thickness of the gas layer is not
restricted to edge-on galaxies, but can be measured for moderately inclined
systems as well.
