Praise be to Allah
Salaat al-haajah is mentioned in a number of da ‘eef hadiths which are not proven to be from the Prophet (blessings and peace of Allah be upon him). Among these hadiths is the report narrated by ‘Abdullah ibn Abi Awfa al-Aslami, who said: The Messenger of Allah (peace and blessings of Allah be upon him) came out to us and said: ‘Whoever has need of something from Allah or any one of His creation, let him do wudoo’ and pray two rak’ahs, then let him say, “There is no god but Allah, the Forbearing, the Most Generous. Glory be to Allah, Lord of the mighty Throne. Praise be to Allah the Lord of the Worlds. O Allah, I ask You for Your mercy and forgiveness and I ask You for all good things and for safety from all sins. I ask You not to leave any sin without forgiving it, or any distress without relieving it, or any need which it pleases You to fulfil without fulfilling it for me.” Then let him ask Allah for whatever matter of this world or the Hereafter that he wishes, for it will be fulfilled.”
Narrated by Ibn Maajah (1374); this hadith is da‘eef (weak).
Al-Tirmidhi said: this is a ghareeb [strange] hadeeth, and concerning its isnaad it was said: Faa’id ibn ‘Abd al-Rahmaan is weak in hadeeth.
Al-Albaani said: rather it is da’eef jiddan (very weak). Al-Haakim said: mawdoo’ (fabricated) ahaadeeth were narrated from Abu Awfa.
Mishkaat al-Masaabeeh, vol. 1, p. 417
In Fataawa al-Lajnah ad-Daa’imah (8/1 62) it says:
That which is called salaat al-haajah was narrated in da‘eef (weak) and munkar (odd) hadiths – as far as we know – that cannot be quoted as evidence. End quote.
See also the answer to question no. 10387
With regard to what you mentioned, that if something troubled him, the Prophet (blessings and peace of Allah be upon him) would get up and pray, this hadith was narrated by Abu Dawood (1319) from the hadith of Hudhayfah (may Allah be pleased with him), and classed as hasan by al-Albaani in Saheeh Abi Dawood (1319)
Doing this is prescribed, without reciting any specific du‘aa’ or doing it in any specific manner. Rather if something upset him at the time of an obligatory prayer, he would pray the obligatory prayer, otherwise he would pray two rak‘ahs, and if he wished, he would offer whatever du‘aa’ he liked in them, without always reciting a specific du‘aa’.
Ibn Katheer (1/253) said, in his commentary on the verse in which Allah, may He be exalted, says (interpretation of the meaning), “And seek help in patience and As-Salat (the prayer)” [al-Baqarah 2:45]:
With regard to the word “As-Salat (the prayer)”, prayer is one of the greatest means of helping oneself to be steadfast, as Allah, may He be exalted, says (interpretation of the meaning):
“Recite (O Muhammad (blessings and peace of Allah be upon him)) what has been revealed to you of the Book (the Quran), and perform As-Salat (Iqamat-as-Salat). Verily, As-Salat (the prayer) prevents from Al-Fahsha (i.e. great sins of every kind, unlawful sexual intercourse, etc.) and Al-Munkar (i.e. disbelief, polytheism, and every kind of evil wicked deed, etc.) and the remembering (praising, etc.) of (you by) Allah (in front of the angels) is greater indeed (than your remembering (praising, etc.) Allah in prayers, etc.)”
Then he narrated from Ibn ‘Abbaas (may Allah be pleased with him) that news was brought to him of his brother’s death whilst he was travelling. He said: “Inna lillahi wa inna ilayhi raaji ‘oon (Truly! To Allah we belong and truly, to Him we shall return)” [al-Baqarah 2:156]. Then he swerved from the road and made his camel kneel, then he prayed two rak‘ahs in which he made the sitting lengthy. Then he got up and walked towards his camel, saying: “And seek help in patience and As-Salat (the prayer) and truly it is extremely heavy and hard except for Al-Khashioon (i.e. the true believers in Allah” [al-Baqarah 2:45]. End quote.
Based on that, what is meant by saying that there is no prayer that is called salaat al-haajah is to rule out this specific prayer.
As for resorting to prayer, for the one who is worried or troubled about something, this is included in the general meaning of the words of Allah (interpretation of the meaning): “And seek help in patience and As-Salat (the prayer)” [al-Baqarah 2:45] and the meaning of the hadith quoted above. That includes both obligatory and supererogatory prayers. There is no specific du‘aa’; rather a person may offer whatever du‘aa’ he wishes, without adhering to a specific du‘aa’.
And Allah knows best.