我使用节点- Coap (https://github.com/mcollina/node-coap)发送Coap数据包,现在我尝试使用有效负载发布或放置请求,但我不知道如何向请求中添加有效负载。我必须使用什么方法或属性来插入有效载荷?
发布于 2017-06-02 12:34:46
在他们的回购中有一个例子:
var req = coap.request('coap://localhost/Matteo')
var payload = {
title: 'this is a test payload',
body: 'containing nothing useful'
}
req.write(JSON.stringify(payload));https://stackoverflow.com/questions/44310586
复制相似问题