首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GroupMe Bot的本地主机POST请求

GroupMe Bot的本地主机POST请求
EN

Stack Overflow用户
提问于 2016-06-21 23:49:06
回答 1查看 195关注 0票数 0

我正在尝试测试我用GroupMe制作的一个Node.js机器人。我用的是GroupMe的GroupMe。在运行foreman startcurl -X POST -d \cool guy\ localhost:5000 (来自类似的问题)之后,我得到了错误curl: (1) Protocol "guy http" not supported or disabled in libcurl。我尝试用双引号包装消息,但这只会导致语法错误。我怎么才能解决这个问题?

编辑:

我试过了

代码语言:javascript
复制
$ curl -X POST -d "cool guy" localhost:5000 

并从工头那里得到了以下错误:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2021-01-24 22:26:47

在localhost前面添加http://。curl使用的库Libcurl支持许多不同的协议。Curl是正确的假设http,但似乎有一个错误。

编辑:在再次阅读问题后,我看到curl是在没有http支持的情况下编译的。如果您自己编译了它,请确保启用http支持。如果使用发行版包管理器安装它,请尝试重新安装。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37956363

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档