How to make your Rocket.Chat app connect with the outside world
In this recipe we will create a slashcommand that runs a GET HTTP based on arguments you provide. We will use the App.RocketChat.Tester as the base project for it. All the code for this recipe is in the branch recipes/http-requests.
You can see the complete documentation on HTTP requests in Rocket.Chat Apps at IHttp's docs page.
You'll need to have handy:
A Rocket.Chat server to deploy the app to
Our Tester App or a newly created app (your choice)
Create the slashcommand
Our command will be called get, so when we call it from the chat, we just have to type /get <url>.
First, let's create a slashcommand directory at the root of the project and add a file named HTTPRequestCommand.ts. Then add the following code:
This function  gets the user who called the command (in this case, yours),  selects the room in which the command was run,  sets the received string as the message and then  sends the message in the room.