Undulatory motion is utilized by crawlers and swimmers such as snakes and sperm at length scales spanning more than seven orders of magnitude. The understanding of this highly efficient form of locomotion requires an experimental characterisation of the passive material properties of the organism as well as of its active force output on the surrounding medium. The millimeter-sized nematode Caenorhabditis elegans provides an excellent biophysical system for both static and dynamic biomechanical studies. Here we present a novel experimental technique where the deflection of a force-calibrated micropipette is used to directly probe the viscoelastic material properties of C. elegans. The worm was shown to have a self-similar elastic structure as well as a surprising shear-thinning viscous component (M. Backholm W. S. Ryu and K. Dalnoki- Veress PNAS 110 (2013)). The excellent force (pN) and time (ms) resolution provided by the micropipette deflection technique also enables measurements of the drag forces experienced by the microswimmer as it moves through a liquid. This direct experimental characterisation of C. elegans provides guidance for theoretical treatments of undulatory locomotion in general.