A woman came to the Messenger of Allah ﷺ and said, "Messenger of Allah, I have come to offer myself to you in marriage."The Messenger of Allah ﷺ looked at her, raising his gaze to examine her and lowering it, then he bowed his head. When the woman saw that he had not made any decision about her, she sat down.A man from among his companions stood up and said, "Messenger of Allah, if you have no need of her, marry her to me."He asked, "Do you have anything?"The man said, "No, by Allah, Messenger of Allah, I have not found anything."He said, "Look, even for an iron ring."So he went away, then returned and said, "No, by Allah, Messenger of Allah, not even an iron ring, but here is my lower garment." Sahl said, "He had no upper garment." "She may have half of it."The Messenger of Allah ﷺ said, "What would she do with your lower garment? If you wear it, she will have nothing of it on her, and if she wears it, you will have nothing of it on you."So the man sat down, and after sitting for a long while, he stood up. The Messenger of Allah ﷺ saw him turning away and ordered that he be called back. When he came, he asked, "How much of the Quran do you know?"He replied, "I know such and such surah, and such and such surah," naming them.He asked, "Can you recite them by heart?"He said, "Yes."He said, "I have given her to you in marriage for what you know of the Quran."
أخبرنا قتيبة قال حدثنا يعقوب عن أبي حازم
أن امرأة جاءت رسول الله ﷺ فقالت يا رسول الله جئت لأهب نفسي لك فنظر إليها رسول الله ﷺ فصعد النظر إليها وصوبه ثم طأطأ رأسه فلما رأت المرأة أنه لم يقض فيها شيئا جلست فقام رجل من أصحابه فقال أي رسول الله إن لم يكن لك بها حاجة فزوجنيها قال هل عندك من شيء فقال لا والله ما وجدت شيئا فقال انظر ولو خاتما من حديد فذهب ثم رجع فقال لا والله يا رسول الله ولا خاتما من حديد ولكن هذا إزاري قال سهل ما له رداء فلها نصفه فقال رسول الله ﷺ ما تصنع بإزارك إن لبسته لم يكن عليها منه شيء وإن لبسته لم يكن عليك منه شيء فجلس الرجل حتى طال مجلسه ثم قام فرآه رسول الله ﷺ موليا فأمر به فدعي فلما جاء قال ماذا معك من القرآن قال معي سورة كذا وسورة كذا عددها فقال هل تقرؤهن عن ظهر قلب قال نعم قال ملكتكها بما معك من القرآن
Sourcing - Bukhari included it in the Virtues of the Quran, chapter on reciting from memory, hadith no. 5030, and Muslim included it in the book of Marriage, chapter on the dowry and the permissibility of it being the teaching of the Quran, an iron ring, and other things ... etc, hadith no. 1425, from Qutayba with the same wording. It is also found in Kubra, hadith no. 5505. Yaqub is Ibn Abdul-Rahman, the reciter.