Alan B. Shepard, Jr.'s historic first manned American space flight, on May 5, 1961, was only supposed to have lasted 15 minutes. But nature would eventually call after weather and technical difficulties delayed the flight for four hours. Shepard threw in the proverbial towel and radioed to the controllers, "I've got to pee." He was told, "No way." With no other option available, Shepard was forced to go right in his suit.
Once space missions became longer, engineers knew they had to equip spacecraft with real bathroom facilities. To function in a weightless environment, these space toilets came equipped with a lap belt, handholds, and foot restraints to ensure that astronauts didn't float away midstream. Because there's no gravity in space, a fan pulled urine and feces into their respective collection containers. A filter removed any unpleasant odors before the air was returned to the cabin.