A caponier is a type of fortification structure. The word originates from the French word "caponnière" - which strictly means capon-cote i.e. chickenhouse.
The fire coming from the feature (e.g. muskets, machine-guns, case-shot etc.) sweeps along the bottom of the attendant ditch that constricts the movement of storming infantrymen to an enfilade alignment of greatest exposure and so prevents the enemy from establishing itself there.
In some types of bastioned fortifications, the caponier served only as a covered means of access to the outworks, with the bastion-trace allowing for the defence of the ditch by fire from the main parapets.
Originally the term referred to a covered passage way that traversed the ditch between the walls of a fortress and a ravelin outside the wall. This was more than simply a passage however as fire from this point could sweep the ditch between the ravelin and the curtain wall and inflict devastating damage on any attempt to storm the wall. Thus the passageway was equipped with musket ports and cannon ports that fired along the ditch.