the best way is to remove it out of the vehicle, wash it, and let it dry. fully. the jute padding on the back will hold water and eventually mold. when we do flood cars, or just cleaning carpets in general, we replace the carpet padding with new. it's cheap. we use laundry detergent along with some lysol to kill any odors.
i washed the carpet in my wife's car. I took it down to the car wash and did it there. but you have to let it dry completely or you will have problems down the road.