Currently, I have an API that requires passing car make, model, and year in the URL. Using an express router post call, I am able to retrieve the query parameters and set them to an object.
I need to ensure that the URL can accept parameters like this: localhost:8080/cars/[make:Audi?model:A4?year:2017]
I'm uncertain about using & and ? in the above URL format, so any corrections are appreciated.
router.post('/:make[not entirely sure but needs to support all params]),
function(req,res)
{
var make: req.query.make // This should capture the make of the car and match it with the query URL
}
Please provide a clear explanation of the actual URL required for making the post call and the URL for router.post
~SRJ