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:13566ʿAffān And Bahz > Hammām > Qatādah > Anas b. Mālik

[Machine] A man came to the Prophet ﷺ while he was on the pulpit and said, "O Messenger of Allah, invoke Allah for rain for us." The Prophet ﷺ invoked Allah for rain and we did not see any cloud in the sky. Then, it rained until we could not see the sun. When it was Friday, that man or someone else stood up and said, "O Messenger of Allah, invoke Allah to withhold the rain from us." The Prophet ﷺ smiled and invoked Allah accordingly. I looked at the cloud and saw it receding to the right and left, leaving no drop of rain.  

أحمد:١٣٥٦٦حَدَّثَنَا عَفَّانُ وَبَهْزٌ قَالَا حَدَّثَنَا هَمَّامٌ أَخْبَرَنَا قَتَادَةُ عَنْ أَنَسِ بْنِ مَالِكٍ

أَنَّ رَجُلًا أَتَى النَّبِيَّ ﷺ وَهُوَ عَلَى الْمِنْبَرِ فَقَالَ يَا رَسُولَ اللهِ اسْتَسْقِ اللهَ لَنَا قَالَ فَاسْتَسْقَى وَمَا نَرَى فِي السَّمَاءِ قَزَعَةً قَالَ فَأُمْطِرْنَا فَمَا جَعَلَتْ تُقْلِعُ فَلَمَّا كَانَتِ الْجُمُعَةُ قَامَ إِلَيْهِ ذَلِكَ الرَّجُلُ أَوْ غَيْرُهُ فَقَالَ يَا رَسُولَ اللهِ ادْعُ اللهَ أَنْ يَرْفَعَهَا عَنَّا قَالَ فَدَعَا قَالَ فَجَعَلْتُ أَنْظُرُ إِلَى السَّحَابِ يُسْفِرُ يَمِينًا وَشِمَالًا وَلَا يُمْطِرُ مِنْ جَوْفِهَا قَطْرَةً