sending data from client to server
Unanswered
American black bear posted this in #help-forum
American black bearOP
This is the network tab while sending form data from client side (via post method) to the server side to add to the database. Is this how it should be? Should the form data and the API route be visible to the browser while am making this request? If no is there a better way to send data from a form to the server.
Additional info:
The form is in a client component
Additional info:
The form is in a client component
1 Reply
@American black bear Use next.js server actions, you can just directly append the Data to the database..
https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations
Regardless of using server actions or making the api route manually, request will be visible in the api call.. and that's completely fine, if you want to avoid that you can also use bcrypt to hash and store to database then compare hashes when needed..
https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations
Regardless of using server actions or making the api route manually, request will be visible in the api call.. and that's completely fine, if you want to avoid that you can also use bcrypt to hash and store to database then compare hashes when needed..