Occasionally, when you have an interaction with officers, they will want to do a search of your body. This helps them to ensure you do not have any weapons on you and can help them to find anything illegal you may be carrying.
Cornell Law School explains you do not always have to consent to a body search, but in some cases, officers have the legal right to do so without your permission.
The warrant requirement
The general rule for law enforcement is they must have a warrant to conduct any type of search. However, there are a great number of exceptions to that rule. Some of those allow for body searches with no warrant requirement.
The main exception, in this case, is probable cause. If an officer has evidence to support his or her belief that you have something dangerous or illegal on your body, then he or she can conduct a search without a warrant and without your permission.
Pat downs and full-body searches
There is a difference between a pat-down and a full-body search. Upon arresting you, the officer can do a full body search, which will usually take place at the jail. Prior to that, he or she will usually just pat you down. Again, you do not have to give your consent.
Really the only time in which you have a say about giving consent for a body search is if the officer asks you directly. Even then, the officer may still have probable cause to carry out the search anyway.