Std testing by using vaginal swab?

When I was bleeding from my miscarrage, my doctor took a culture from my vagina and said he will perform my std test with that sample. I never knew doctors tested for stds via vaginal swab. Is this even possible? I thought it std testing were done via blood test.