If I'm just barely winning the war, I'll ask for techs for peace. Especially early in the game when I can't keep the catapult numbers up.
If the war is close, the AI often sends a strike force by galley to my supply lines. If my reinforcements can intercept it, that's great. If it looks like he might get in behind my lines, I try to take a city, pillage whatever valuable improvements I can (horse archers are great for this), and then sue for peace all on the same turn. I start demanding all his techs, then gradually remove them until he accepts. I try to get the highest beaker value of techs, unless he has something crucial like iron working.
When you have him beaten down to a single city and will obviously overwhelm him, my experience is the same as others': he'll take that knowledge to his grave (which you'll soon own).