[RPG] Can you take a rest during combat

combatdnd-5erests

Is there a rule either in the DMG / PHB that states a party can take a long/short rest while actively in combat?

The scenario:

The Current campaign is being played on Roll20. When combat starts and initiative is rolled, there is a visible turn order that appears showing who (including mobs) goes next.

So we are clearing this village and combat starts, and we defeat all the enemies we can see, but as the DM did not remove the turn order and kept asking us what we were doing for our turns we assumed that there were still enemies to fight. One of the paladins uses Divine Sense and locates some enemies in a building next to us.
We go in and are thrown into what I believe to be a deadly encounter for our level: 3 Banshees and a Wraith (our 5 member party is level 6).

We survive… just, and we question why we were given a deadly encounter in session 1 of the campaign. The DM calmly informed us that it was well within our rights to take a rest in the middle of combat and we could have left combat at any time.

TL;DR: While actively in combat, can you as per the rules take a long or short rest?

Best Answer

According to the PHB page 186:

A short rest is a period of downtime, at least 1 hour long, during which a character does nothing more strenuous than eating, drinking, reading, and tending to wounds.

It doesn't say anything about combat, so that doesn't matter. You can just declare "My character sits down and takes a short rest". The short rest might get interrupted if the character gets hit by a monster or gets up and fights, but if that doesn't happen within 1 hour it counts as a short rest.

From the moved comments: This is not just silly, it can lead to interesting gameplay. For example a fighter might hold off the enemy long enough for the warlock to regain spell slots in order to fly them out of trouble.
Additionally attempting to rest means the DM has to either reveal the monster or let you rest which could be useful.