-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
nodebb version 1.13.2
nodebb-plugin-write-api version 5.7.3
node.js version 12.14.1
post data:
username=Panama.City&password=12345678&email=panama.city%40domain.com
http request option:
{ hostname: 'localhost',
port: 4567,
path: '/api/v2/users',
method: 'POST',
timeout: 5000,
headers:
{ Authorization: 'Bearer <token>' } }
var req = require('http').request(options, (res) => {
let data = '';
// A chunk of data has been recieved.
res.on('data', (chunk) => {
data += chunk;
});
// The whole response has been received. Print out the result.
res.on('end', () => {
console.log(data);
var rt = JSON.parse(data);
if (callback) callback({status: 'success'});
});
req.on('error', (e) => {
if (callback) callback({status: 'failure'});
});
});
req.write(postData);
req.end();
Error: "value" required in setHeader("accessToken", value)
at validateHeader (_http_outgoing.js:492:11)
at ClientRequest.setHeader (_http_outgoing.js:501:3)
at new ClientRequest (_http_client.js:173:14)
at Object.request (http.js:38:10)
Any idea what I did wrong there? Thank you for an excellent plugin to an excellent forum platform.
Metadata
Metadata
Assignees
Labels
No labels