Book by James Leo Herlihy
Midnight Cowboy is a 1965 novel by James Leo Herlihy that chronicles the naïve Texan Joe Buck's odyssey from Texas to New York City, where he plans on realizing his dream of becoming a male prostitute servicing rich women.
Plot.
The book opens with would-be gigolo Joe Buck leaving Houston to seek his fortune back east, chasing his dream of becoming a hustler for sex-starved rich ladies in New York City. Dim-witted, naïve, but strapping and handsome, Joe has spent the past two years cultivating a cowboy persona and saving up his dishwashing wages for a brand new cowboy wardrobe.
The book recounts the events of his life that lead up to this point. Born out of wedlock, Joe is abandoned by his mother at the age of 7. He is raised in Albuquerque by his grandmother, Sally Buck, a flirty blonde hairdresser who takes care of his needs but emotionally neglects him in favor of an endless string of boyfriends. One of those boyfriends, the cowboy Woodsy Niles, is the closest thing Joe has to a father figure, but he too exits Joe's life forever once his relationship with Sally ends. Joe grows up profoundly isolated and lonely, desperately wanting but clueless on how to form connections with other people.
When Joe is 17, he loses his virginity to Anastasia Pratt, a promiscuous schoolgirl who regularly took on six boys at a time in a movie theater storeroom, each boy patiently waiting in line for his turn. Joe is the first boy she enjoys having sex with, leading to a secret relationship that is squelched when one of the other boys alerts Annie's father to her sexual activities out of jealousy. Annie is swiftly institutionalized, and the unsavory rumors surrounding Joe's involvement only serve to depress and alienate him. 
In the following years, he has occasional brief sexual dalliances with both men and women in the hopes of securing their friendship, but they are only ever interested in his body. He drifts aimlessly into his 20s, jobless, friendless, and idle, still living with and supported by his grandmother.
Joe is drafted into the US Army at the age of 23. For the first time in his life he finds camaraderie and acceptance, if not outright friendship. Tragically, Sally Buck dies in a horseback accident toward the end of Joe's enlistment. He suffers a nervous breakdown at the loss of the only real human connection in his life.
Discharged from the army, unmoored, and consumed by grief, Joe decides to leave Albuquerque for Houston. There, he attracts the attention of a local male hustler named Perry. Joe's simple delight at having attention paid to him by a cool new friend is misinterpreted by Perry as a reciprocation of sexual attraction. Perry takes Joe to a hotel room, gives him marijuana for the first time, and attempts to initiate a sexual encounter. Instead, the drugs cause Joe to suffer an existential crisis, and he babbles tearfully on the floor about his desire to have a blonde wife to fawn over him and take care of all his needs.
An annoyed Perry takes Joe to a Tex-Mex brothel run by a grotesque madam and her sexually deviant son. Joe is thrilled by this apparent gesture of friendship, though it's implied that Perry intends the trip as a punishment for having been led on. As Joe is having tender and spirited sex with a prostitute, he catches the others spying on him through a hidden room. He attacks Perry, but is then assaulted and raped by the madam's son.
Joe is deeply traumatized by the attack and by Perry's betrayal. He resolves to harness all his anger to reinvent himself and focus on a goal, inspired by an offhand comment made by the brothel madam: He will become a hustling cowboy and seek his fortune in New York City, servicing the legions of sex-starved society women waiting for him there. 
Joe Buck arrives in New York by bus and checks into a hotel. Initially unsuccessful, he manages to bed a middle-aged woman, Cass, in her posh Park Avenue apartment. But the encounter ends badly: He ends up giving "her" money after she is insulted when he requests payment. It's also implied through her phone conversations that Cass herself is a high-class call girl.
Afterwards at a bar, Joe meets Enrico Salvatore "Ratso" Rizzo, a crippled young swindler who takes $20 from him for ostensibly introducing him to a pimp. After discovering that the man is actually an unhinged religious fanatic, Joe flees in pursuit of Ratso but cannot find him. Joe spends his days wandering the city and sitting in his hotel. Soon broke, he is locked out of his hotel room and most of his belongings are impounded.
Desperate for money to get back his things, Joe tries to solicit male clients on 42nd street. He receives oral sex from a young man, but learns after the act that the young man has no money. Joe threatens him and asks for his watch, but eventually lets him go unharmed. 
Joe wanders homeless and utterly alone for weeks, until by chance he spots Ratso in a diner. Simultaneously overjoyed at the sight of a familiar face and furious over having been conned, Joe angrily shakes him down. Ratso only has a few bits of change in his pockets, but he offers to share with Joe the condemned apartment where he is squatting. Joe reluctantly accepts his offer. 
Together, the two of them eke out a marginal existence, their days spent on various schemes to raise funds for their survival. Despite their squalid circumstances, Joe finds himself happier than he has ever been, because in Ratso he has found the friendship and companionship that he has always longed for. Ratso tells Joe about his dream of going to Florida, a splendid paradise where life is always easy and all your needs are met. Time passes, and Ratso's health grows worse. 
One day, Joe is scouted by Hansel and Gretel MacAlbertson, a pair of bohemian siblings, and handed an invitation to a Warhol-esque loft party. Joe and Ratso attend. Joe gets high off a pill Gretel gives him, and leaves the party with a socialite who agrees to pay him $20 for the novelty of spending the night with a male hustler. An ailing Ratso falls down the stairs, and makes his own way home. Meanwhile, Joe is aghast to find himself unable to perform in bed, but after reflecting on his wearying experiences in New York City he successfully makes wild, raw, violent love to the socialite.
Joe returns to their flat flush with success, carrying new socks and medicine for Ratso. He finds him bedridden and feverish, having lost the ability to walk. Dimly aware that his friend is dying, Joe announces that he is going to take them to Florida that very night. 
Joe picks up a middle-aged man in an amusement arcade. The man takes Joe back to his hotel room and wastes the entire evening tediously talking at him before ultimately backing out of the transaction. Desperate, Joe robs him, and brutally beats him when he tries to phone for help. He buys bus tickets with the money and puts himself and Ratso on the next bus to Florida. 
Joe resolves to stop hustling, and tells Ratso that he plans to get a regular job in Florida. To his own surprise, he promises Ratso that he means to take care of them both. Joe reflects positively on his journey and his own newfound maturity. 
Ratso's health deteriorates over the course of the long bus ride. He becomes incontinent, and eventually unresponsive. Joe buys new clothing for Ratso and himself at a rest stop, and discards his cowboy outfit. Shortly before arrival, Joe wakes up to discover that Ratso has died. 
He is unsurprised, and finds himself continuing to make responsible plans for the future: to bury Ratso properly, and to find a job to pay for the burial and headstone. The driver tells Joe there is nothing to do but continue to Miami and asks Joe to close Ratso's eyes. Alone in the world once more, Joe sits with his arm around his dead friend for the last few miles of their journey.
Film adaptation.
In 1969, the novel was made into the movie "Midnight Cowboy" starring Dustin Hoffman as Ratso and Jon Voight as Joe in his first film role. The film depicted the second half of the book, with events from the first half condensed or briefly seen as flashbacks.
Directed by John Schlesinger and written by Waldo Salt, the film was commercially and critically successful. At the 42nd Academy Awards, the film won the Academy Award for Best Picture, Academy Award for Best Director and Academy Award for Best Writing (Adapted Screenplay). Both Hoffman and Voight were nominated for the Academy Award for Best Actor. For her portrayal of Cass, Sylvia Miles also received a nomination for Best Supporting Actress.
Schlesinger explained the great success of the film as its exploration of loneliness.
In 2021, journalist Glenn Frankel published "Shooting Midnight Cowboy: Art, Sex, Loneliness, Liberation and the Making of a Dark Classic", a non-fiction account of the making of the film that is also an in-depth exploration of the author James Leo Herlihy and his writing of the source novel.
References.
 ;templatestyles src="Reflist/styles.css" / ;