vahlala
vahlala

Reputation: 395

Localhost POST request for GroupMe Bot

I'm trying to test a GroupMe bot that I made using Node.js. I'm using the Example Bot by GroupMe. After running foreman start and curl -X POST -d \cool guy\ localhost:5000 (from a similar question), I get the error curl: (1) Protocol "guy http" not supported or disabled in libcurl. I tried wrapping the message in double quotes, but that only resulted in a syntax error. How can I fix this?

Edit:

I tried

$ curl -X POST -d "cool guy" localhost:5000 

and got the following error from foreman:

22:04:16 web.1  | started with pid 5788
22:04:32 web.1  | undefined:1
22:04:32 web.1  | cool guy
22:04:32 web.1  | ^
22:04:32 web.1  | SyntaxError: Unexpected token c
22:04:32 web.1  |     at Object.parse (native)
22:04:32 web.1  |     at Object.respond (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\bot.js:11:24)
22:04:32 web.1  |     at apply (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\node_modules\director\lib\director\router.js:448:19)
22:04:32 web.1  |     at _every (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\node_modules\director\lib\director\router.js:30:9)
22:04:32 web.1  |     at Router.invoke (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\node_modules\director\lib\director\router.js:454:5)
22:04:32 web.1  |     at IncomingMessage.parseAndInvoke (C:\Users\Nicky\Documents\GitHub\groupme-jarvis\node_modules\director\lib\director\http\index.js:175:10)
22:04:32 web.1  |     at IncomingMessage.g (events.js:199:16)
22:04:32 web.1  |     at IncomingMessage.emit (events.js:104:17)
22:04:32 web.1  |     at _stream_readable.js:908:16
22:04:32 web.1  |     at process._tickCallback (node.js:355:11)
22:04:32 web.1  | exited with code 1
22:04:32 system | sending SIGKILL to all processes

Upvotes: 0

Views: 226

Answers (1)

Minecraftchest1
Minecraftchest1

Reputation: 124

Add http:// in front of localhost. Libcurl, the library that curl uses, supports many different protocols. Curl is correctly assuming http, but seems to be have a bug.

Edit: after reading the question again, I see that curl was compiled without http support. If you compiled it yourself, make sure to enable http support. If you installed it using a distributions package manager, try reinstalling.

Upvotes: 0

Related Questions