I need to know how to use api in nodejs request.(POST)
request(options, callback);
var headers = {
'Content-Type': 'application/json',
'Accept':'application/json',
'Grpc-Metadata-Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJleHAiOjE1MjkxMTI0MzMsImlzcyI6ImxvcmEtYXBwLXNlcnZlciIsIm5iZiI6MTUyOTAyNjAzMywic3ViIjoidXNlciIsInVzZXJuYW1lIjoiYWRtaW4ifQ.fTHoa3JlLA6M1DhVyOIYothquStxV8c5uAQLEpg_nw8'
};
var dataString = {
"adrInterval": 0,
"appEUI": "3000000000010752",
"appKey": "10000000000000000000000000000001",
"applicationID": 1,
"description": "3000000000010752",
"devEUI": "3000000000010752",
"installationMargin": 0,
"isABP": false,
"isClassC": false,
"name": "3000000000010752",
"relaxFCnt": false,
"rx1DROffset": 0,
"rx2DR": 0,
"rxDelay": 0,
"rxWindow": "RX1",
"useApplicationSettings": true
};
var options = {
url: 'https://localhost:8080/api/nodes',
method: 'POST',
headers: headers,
body: dataString
};
I post node with api like this source code but can’t register device node in network server.
Do i need to something for using api with that code?
I think authorization or secure problem.
Please Help this problem.