We said, "Messenger of Allah, you send us out and we stay with people who do not show us hospitality. What do you think?"The Messenger of Allah ﷺ said to us, "If you stay with people and they offer you what is fitting for a guest, accept it. If they do not, then take from them the guest's due that they owe you."
قلنا: يا رسول الله، إنك تبعثنا، فننزل بقوم فلا يقروننا، فما ترى؟ فقال لنا رسول الله ﷺ: إن نزلتم بقوم فأمروا لكم بما ينبغي للضيف فاقبلوا، فإن لم يفعلوا، فخذوا منهم حق الضيف الذي ينبغي لهم.
Bukhari narrated it in al-Adab (6137), and Muslim in al-Luqata (1727), both of them through the route of Layth, from Yazid bin Abu Habib, from Abu Khayr, from Uqba bin Amir, who said, and then he related it.