I got Error 400(Bad request) and i just get started so I don’t know what should I do to solve this problem i working on ubuntu i don’t think it’s a bug from ubuntu but i want to tell u just for make sure there is any problem from using ubuntu
This is my code
exports.createScream = functions.https.onRequest((req, res) => {
const newScream = {
body: req.body.body,
userHandle: req.body.userHandle,
createAt: admin.firestore.Timestamp.fromDate(new Date()),
};
admin.firestore()
.collection("scream")
.add(newScream)
.then((doc) => {
res.json({message: `document ${doc.id} created successfully`});
})
.catch((err) => {
res.status(500).json({error: "something went wrong"});
console.error(err);
});
});
and this is my error
and this for my header
i already check the url and clear the cache i don’t know how should i do next