Make a POST inside a GET request?
Unanswered
Whiteleg shrimp posted this in #help-forum
Whiteleg shrimpOP
I want to make a "post" request inside my GET request method. Is this frowned upon? Or okay?
export default function handler(req, res) {
if (req.method === 'GET') {
// check db if user is there (db.get())
// if not run the POST request to add user details. (db.save())
}
}1 Reply
@Whiteleg shrimp I want to make a "post" request inside my GET request method. Is this frowned upon? Or okay?
export default function handler(req, res) {
if (req.method === 'GET') {
// check db if user is there (db.get())
// if not run the POST request to add user details. (db.save())
}
}
its pretty much frowned upon. why not just put your POST logic directly there?