+ 2
throw'er error 287
I'm getting a throw'er error 287 in the command line when sending a respond using api, please help.
10 Respostas
+ 3
this seems to be error on the api's side
+ 3
Which api are you using?
Are you talking about an http response?
+ 3
Can you insert the code or a similar working snippet so i can look for errors
+ 2
i guess you should report it to the api provider and try using a different api for now
+ 2
I just search on the net but this error code gave me results only about VBA so i guess it was a problem on server side
0
Yes
0
var express = require("express");
var bodyParser = require("body-parser");
var request = require("request");
const https = require("https");
const app = express();
app.use(express.static("public"));
app.use(bodyParser.urlencoded({extended:true}));
app.get("/", function(req, res){
res.sendFile(__dirname + "/signup.html");
});
app.post("/", function(req, res){
var name = req.body.fName;
var laName = req.body.lName;
var email = req.body.email;
var data = {
members:[
{
email_address:email,
status: "subscribed",
merge_fields: {
FNAME:name,
LNAME:laName,
},
}
]
};
var jsonData = JSON.stringify(data);
const url = "https://us18.api.mailchimp.com/3.0/lists/8cddd96f04";
const options = {
method: "POST",
auth: "moshie:8964e9ee6c6f3379071bf950b2e1c4ca-us18",
};
const request = https.request(url, options, function(response){
if (response.statusCode === 200){
res.send("sucess");
}
else{
res.send("problem");
}
response.on("data", function(data){
console.log(JSON.parse(data));
});
});
request.write(jsonData);
request.end();
});
app.listen(3000, function(){
console.log("serving on server 3000");
});
0
What am I supposed to do?
0
Thanks!
0
Any dictionary where I can see error code meanings? for the future