OED attests "rap" in this sense of punishment back to the 1860s at least, and "face the rap," "beat the rap," etc., to the early 1900s. "Rap sheet," the 50s.
OED attests "rap" in this sense of punishment back to the 1860s at least, and "face the rap," "beat the rap," etc., to the early 1900s. "Rap sheet," the 50s.