In college, Detwiler pitched for Missouri State University of the Missouri Valley Conference. In 2006, he was a member of the All-MVC Tournament team, and he also pitched 101⁄3 innings in two starts for Falmouth in the Cape Cod League, accruing a 1.74 ERA, striking out 14 batters, and issuing three walks before moving on to play for Team USA. In 2007, he finished his third year with a 2.22 ERA in 14 starts and 100 strikeouts in 89 innings.
During the summer of his freshman year in college Detwiler played for Wentzville Legion Post 323.
After being drafted and signed by the Nationals, he pitched four games in the rookie Gulf Coast League, and then five games with the high A Potomac Nationals. On September 7, 2007, he made his major-league debut, pitching one hitless inning in relief against the Atlanta Braves, striking out one. He became the first player drafted in the 2007 Draft to appear in a major-league game. He joined Cordero and Ryan Zimmerman as the third member of the Nationals franchise to be called up to the major leagues in the same year that he was drafted.
Detwiler opened the 2009 season with the Harrisburg Senators of the Class AA Eastern League. However, due to the injury of Scott Olsen, he was called up to start on May 18 against the Pirates. He went 5 innings and allowed 3 runs, striking out 6. Although he was 1–6 with a 5.00 ERA in 15 games with the Nationals in 2009, he went 1–1 with a 2.08 ERA in four September starts.
On February 18, 2010, Detwiler underwent hip surgery due to a labral tear.
Detwiler made his return to major league play in July 2011 after recovering from hip surgery, and he remained in rotation for the remainder of the 2011 season. Detwiler finished the 2011 season with a 4–5 win loss record and a 3.00 ERA.
Detwiler was named to the starting rotation for the 2012 season. Although he pitched effectively, the return of Chien-Ming Wang from injury put Detwiler in the long relief role in late May. Wang struggled in the rotation, granting Detwiler a return to the rotation a few weeks later. He was a regular starter for the rest of the year, finishing with 27 starts, plus a six-inning start, in which he allowed one unearned run, in game 4 of the 2012 NLDS.
Detwiler missed significant time in 2013 with an oblique injury and a pinched nerve in his back. He finished the year with just 711⁄3 innings pitched and a 4.04 ERA.