Problem solved, it was the wrong url....
POST Data Azure Function
I am using Azure Function as a POST API to post the body to an MongoDB. With the code below module.exports = async function (context, req) { await client.connect(); const database = client.db("test"); const collection = database.collection("notes"); const json = req.get await collection.insertOne(req.body) } Everything is working in debug mode, I checked with POSTman but once I send the code to deploy on Azure, the post does not work, and I get this html page? I don't understand ![65843-image.png][1] [1]: /api/attachments/65843-image.png?platform=QnA
Azure Functions
1 additional answer
Sort by: Most helpful
-
sadomovalex 3,636 Reputation points
2021-02-09T15:52:57.45+00:00 could you show what is returned in page body (1st tab in Postman response)? on your screenshot only returned headers are shown which don't tell much. When response has text/html type often page itself contains description of error