The urinary tract is a common site of infection. The complete mechanisms of urinary tract infection (UTI) are still unknown. In general, the strategies of the uropathogenic Escherichia coli are adherence, motility, iron acquisition, toxin, and evasion of host immunity. Host immune responses play a significant part in defense of UTI. Various antimicrobial peptides (AMPs) including defensins, cathelicidin, hepcidin, ribonuclease 7, lactoferrin, lipocalin, Tamm-Horsfall protein, and secretory leukocyte proteinase inhibitor help to prevent UTI by modulation of innate and adaptive immunity. Toll-like receptors (TLRs) play an important role of microorganism identification in innate immunity. Stimulation of TLRs on the cell membrane by ligand of bacteria triggers production of inflammatory chemokines, cytokines, and AMPs. These mechanisms are an attempt to defend the urinary tract against UTI.