我正在尝试使用RabbitMQ HTTP REST客户端将消息发布到队列中。我正在使用以下网址和请求
http://xxxx/api/exchanges/xxxx/exc.notif/publish
{
"routing_key":"routing.key",
"payload":{
},
"payload_encoding":"string",
"properties":{
"headers":{
"notif_d":"TEST",
"notif_k": ["example1", "example2"],
"userModTime":"timestamp"
}
}
}
并从兔子那里得到以下响应:
{"error":"bad_request","reason":"payload_not_string"}
我只设置了一个 header :
Content-Type:application/json
我试图设定
"payload_encoding":"base64",
但这没有帮助。我是兔子的新手,欢迎任何回应。
最佳答案
尝试一下
{
"properties": {
"content-type": "application/json"
},
"routing_key": "testKey",
"payload": "1234",
"payload_encoding": "string"
}
关于json - RabbitMQ REST HTTP JSON有效负载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44905126/