You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
curl command did work. but it returns {"error": "Invalid Access Token"} and created the user account anyway. I am on amazon EC2 cloud... error could be from the server.
Activity
julianlam commentedon Jun 8, 2020
To preclude an error with write-api, please try doing the request via cURL:
curl -H "Authorization: Bearer <token>" -X POST localhost:4567/api/v2/users --data "username=Panama.City&password=12345678&email=panama.city%40domain.com"monoto commentedon Jun 8, 2020
curl command did work. but it returns {"error": "Invalid Access Token"} and created the user account anyway. I am on amazon EC2 cloud... error could be from the server.
julianlam commentedon Jun 8, 2020
Doesn't look like one of the write-api's errors, so I don't think it's us that's sending it...