以下对RabbitMQ的API调用:
http -a USER:PASS localhost:15001/api/queues/
返回队列列表:
[
{
...
"messages_unacknowledged_ram": 0,
"name": "foo_queue",
"node": "rabbit@queue-monster-01",
"policy": "",
"state": "running",
"vhost": "/"
},
...
]
请注意,vhost
参数为/
。
如何使用/
vhost
进行/api/queues/vhost/name
调用,该调用会返回特定队列的详细信息?
我试过了:
localhost:15001/api/queues/\//foo_queue
localhost:15001/api/queues///foo_queue
但是404 Object Not Found
都失败了:
答案 0 :(得分:13)
URL Encoding成功了。网址应为:
localhost:15001/api/queues/%2F/foo_queue
⬆⬆⬆
对于记录,我认为REST资源不应该命名为/
,特别是默认情况下不会。