我正在尝试测试我使用 Node.js 制作的 GroupMe 机器人。我正在使用 GroupMe 的示例机器人。运行后 foreman start
(
curl -X POST -d \cool guy\ localhost:5000
来自一个类似的问题),我得到了错误curl: (1) Protocol "guy http" not supported or disabled in libcurl
。我尝试将消息用双引号括起来,但这只会导致语法错误。我怎样才能解决这个问题?
编辑:
我试过了
$ curl -X POST -d "cool guy" localhost:5000
并从工头那里得到以下错误:
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