I am building a Roku tv channel, I have displayed a keyboard so user can type, and there are two buttons to search, I have made an observer on these buttons, when the button is pressed, I want to make a get request to get results, but the API call is not succeeding in components/keyboard.brs which is linked with components/keyboard.xml, but this same API call succeed if I call in source/main.brs on the top.

Can't understand this, please let me know if you know something about that, or any resource where can I find these things. Thanks in advance.

All http requests need to be performed on a task thread.
You can see a working example of this on Roku's github samples repository here.
Here's the snippet of task code from that sample:
And this is how you create and start the task:
You can see a slightly more complex example of http requests in a task here on the RokuCommunity sample-projects repo: https://github.com/rokucommunity/sample-projects/tree/master/standard-with-task