Male homosexual literature (I'm not talking "Porn") really didn't take off until the latter half of the 19th century with the likes of the inspiration of the US writer/poet Walt Whitman and the UK writer John Addington Symonds (please look at the wikipidea entries on pedastry and paedophilia and whilst you're at it look up "Ages of Consent").
The UK male homosexual literature movement of the late 19th/early 20th century has become known as the "Uranian" movement. It was always discrete and euphemistic. Perhaps the two definitive academic works on the Uranian movement are Love in Earnest by Timothy d'Arch-Smith and Sexual Heretics, an anthology with a lengthy introduction edited/written by Brian Reade.
Oscar Wilde's failed libel case with the Marquis of Queensbury over his supposed, but actual, homosexual relationship with the Marquis' son, Lord Alfred Douglas, considerably dampened the enthusiasm of the Uranian writers. Oscar Wilde served 2 two years of penal servitude resulting in his famous poem "The Ballad of Reading Jail" and then went into exile in France where the deterioration in his health during his imprisonment soon led to his death.
But in post-WW1 Germany, Berlin thrived on its high-life including its gay clubs. Christopher Isherwood's collection of Berlin scenarios “Goodbye to Berlin”, which inspired the film Cabaret, seems to be an accurate portrayal of Berlin at that time.
One of the books I am currently reading is "The Hustler" by John Henry Mackay, first published in Germany in 1926 as "Der Puppenjunge" under the pseudonym Sagitta and not translated into English until 1985. Mackay was of mixed Scottish-German parentage and moved back to Germany at the age of two after the death of his father. He was more well-known as a writer of anarchist treatises than gay literature.
It relates the story of a 15 year-old boy, Gunther, who arrives alone in Berlin and soon becomes a prostitute, a rent boy. He is picked up by a young man,a closet gay, Hermann, who falls hopelessly in love with him. The novel relates the conflict between a love affair and life as a rent boy.
In contrast to the rather saccharin and euphemistic literature of the Uranian movement, The Hustler, although certainly not pornographic, deals with its theme of male prostitution straight-on.
Mackay died, perhaps fortunately, in 1933, the year Hitler came to power. He would not have survived under the Nazi regime - probably more due to his anarchist beliefs than if the identity of Sagitta had been revealed.
J.H.Mackay 1926. The Hustler. Translation H. Kennedy 1985. Alyson Publications