We investigate the capillary force that applies on a tilted cylinder as a function of its dipping angle i, using a home-built tilting Atomic Force Microscope (AFM) with custom made probes. A micrometric-size rod is glued at the end of an AFM cantilever of known stiffness, whose deflection is measured when the cylindrical probe is dipped in and retracted from reference liquids. We show that a torque correction is necessary to understand the measured deflection. The results are compatible with a vertical capillary force varying as 1/ cos i, in agreement with a recent theoretical prediction. We also discuss the accuracy of the method for measuring the surface tension times the cosine of the contact angle of the liquid on the hanging fiber.