【发布时间】:2014-09-02 10:55:03
【问题描述】:
我看到有一个 websocket 端点可以通过 Java 测试解决问题。在日志中我看到了
Connecting to: ws://127.0.0.1:8080/76f48a44-0af8-444c-ba97-3f1ed34afc91/tweets
就像任何其他 REST API 一样,我想通过浏览器或 curl 访问它,但是当我这样做时,我看到了
➜ tweetstream git:(master) ✗ curl ws://127.0.0.1:8080/b9b90525-4cd4-43de-b893-7ef107ad06c2/tweets
curl: (1) Protocol ws not supported or disabled in libcurl
和
➜ tweetstream git:(master) ✗ curl http://127.0.0.1:8080/b9b90525-4cd4-43de-b893-7ef107ad06c2/tweets
<html><head><title>Error</title></head><body>Not Found</body></html>%
有没有办法用浏览器/curl 测试 websocket API?
【问题讨论】:
-
Websockets 不像 HTTP 那样是一个 RESTful 协议。确保为工作使用正确的工具。
-
您知道合适的工具吗?我对 websockets 很陌生
标签: javascript curl websocket