Testing post request with GroupMe Bot

2019-09-07 13:10发布

问题:

I just started building a GroupMe bot which i'm super excited about. I am using the GroupMe NodeJS Callback bot. I am currently running it locally with foreman start and everything works well but I cannot figure out how to test its responses. For example: I like to say "Hey guy" and see if the bot returns a response, such as "Im not your buddy guy." I was thinking a curl request but I am not sure where to start. Please help! (I will be around to answer question thanks!!)

回答1:

I figured out a way, even though it isn't ideal it works just fine. You need to open 2 terminals. The first will have the application running locally. The second you need to type:
curl -X POST -d '{"text" : "some_random_text", "bot_id" : "YOUR_BOT_ID"}' localhost:5000



标签: node.js bots