So there is something called The Ben Franklin effect, [0] which basically says that people are more likely to befriend/like you if you ask them to do you a big favor rather than the other way around.
The psychological explanation is that people will smooth the cognitive dissonance between their indifference and/or antipathy to you and the fact that they have actually done a favor for you by revising their opinion of you.
Of course asking a favor from someone who is indifferent or slightly hostile toward you may only confirm their misgivings, and I've never tried such a strategy myself, but I have read that such favor-seeking often works.
In the Wikipedis link, Franklin is quoted from his autobiography as follows:
-------
"Having heard that [a rival legislator] had in his library a certain very scarce and curious book, I wrote a note to him, expressing my desire of perusing that book, and requesting he would do me the favour of lending it to me for a few days. He sent it immediately, and I return'd it in about a week with another note, expressing strongly my sense of the favour. When we next met in the House, he spoke to me (which he had never done before), and with great civility; and he ever after manifested a readiness to serve me on all occasions, so that we became great friends, and our friendship continued to his death.
-------
[0] https://en.wikipedia.org/wiki/Ben_Franklin_effect
EDIT: added prepositional phrase