This is from Frank Tatchell, a traveller and English clergyman, who was rambling around in the 1920s.
"The mongrel curs are a nuisance to the wayfarer in most foreign lands. It is useless to try and 'good dog' them. Instead, abuse them in the hoarsest voice at your command and with the worst language you can think of. They may slink off utterly ashamed of themselves, but, if one comes for you, try this method. Snatch off your hat and hold it out to him, when he will snap at it and seize it by the brim. Now the length of your hat and arm is exactly the length of your leg, and, if you kick out, he will get it just under the jaw, bite his tongue and go off howling. Approaching a dog sleeping in the road, I do so whistling. This wakes him up before I get close and helps to convince him that I am human, in spite of the bag on my shoulder and my outlandish smell."