Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ahmad:22141Rawḥ > Mahdī b. Maymūn > Muḥammad b. Abū Yaʿqūb > Rajāʾ b. Ḥaywah > Abū Umāmah

[Machine] The Messenger of Allah ﷺ initiated a military campaign, so I went to him and he mentioned its purpose except that he said, "Allow me to do a deed that I take from you, and may Allah benefit me with it." He said, "You should observe fasting."  

أحمد:٢٢١٤١حَدَّثَنَا رَوْحٌ حَدَّثَنَا مَهْدِيُّ بْنُ مَيْمُونٍ حَدَّثَنَا مُحَمَّدُ بْنُ أَبِي يَعْقُوبَ عَنْ رَجَاءِ بْنِ حَيْوَةَ عَنْ أَبِي أُمَامَةَ قَالَ

أَنْشَأَ رَسُولُ اللهِ ﷺ غَزْوًا فَأَتَيْتُهُ فَذَكَرَ مَعْنَاهُ إِلَّا أَنَّهُ قَالَ مُرْنِي بِعَمَلٍ آخُذُهُ عَنْكَ يَنْفَعُنِي اللهُ بِهِ قَالَ عَلَيْكَ بِالصَّوْمِ