I am using NodeJS and Express, and I want to get the Username and Password parameters from a request. I've searched for a while now, and I can't find my answer.
I want to accept a user
parameter from a cURL command:
curl --request --POST -u USERNAME:PASSWORD -H "Content-Type:application/json" -d "{\"key":\"value\"}" --url https://api.example.com/my_endpoint
In my application:
app.post('/my_endpoint', async (req, res, next) => {
const kwargs =. req.body;
const userName = req['?'];
const password = req['?'];
});