https://www.nps.gov/articles/mr-madison-s-war.htm
As they grew increasingly frustrated by the failure of President Jeffersons and Madisons policies of economic sanctions to win concessions from the British, a faction of congressmen known as the War Hawks began calling for more decisive and aggressive measures.
On June 1, 1812 President James Madison sent his war message to Congress. That message outlined what he believed to be Americas chief diplomatic grievances with Britain: impressment, the British Orders in Council, and Britains incitement of Indian warfare on Americas western frontier.
The Constitution gives the power to declare war to Congress. No Congress had exercised that power in the countrys nearly 25-year history. But in June 1812, the House and Senate narrowly approved the measure declaring war on the British. President Madison signed the Congressional war measures into law on June 18, 1812, marking the official commencement of the hostilities.
But enthusiasm for war against Britain was hardly unanimous. The vote in the House was 79 to 49; nearly four in ten representatives voted against the measure. The vote in the Senate was even closer, with 19 senators in favor and 13 opposed. It remains the closest vote in Americas five formally-declared wars.
And the vote occurred along strictly partisan lines. All 98 of the congressmen who voted for the war were Republicans. (Even within the Republican party, support for the war was hardly unanimous: one-quarter of Republicans either voted against the measure or abstained from the vote.) Not a single Federalist voted for the war. The partisan divisions led critics to later pronounce the War of 1812 "Mr. Madison's War."