lwm2m-node-lib icon indicating copy to clipboard operation
lwm2m-node-lib copied to clipboard

updateConnection operation should use POST(CoAP) method

Open wukaishanda08 opened this issue 8 years ago • 1 comments

In file lwm2m-client.js

function updateRegistration(deviceInformation, callback) { var rs = new Readable(), creationRequest = { host: deviceInformation.currentHost, port: deviceInformation.currentPort, method: 'PUT', pathname: deviceInformation.location, query: 'lt=' + config.client.lifetime + '&lwm2m=' + config.client.version + '&b=U' },

The method "PUT" should be "POST". There is no log while updateConnection use PUT. But the console outputs the right log while use POST

wukaishanda08 avatar Jul 20 '17 10:07 wukaishanda08

The lwm2m-server.js recieve POST method, so as the LWM2M Document.

serverInfo.routes = [
    ['POST', /^\/rd$/, 'registration'],
    ['DELETE', /\/rd\/.*/, 'unregistration'],
    ['POST', /\/rd\/.*/, 'updateRegistration']
];

wukaishanda08 avatar Jul 20 '17 10:07 wukaishanda08