Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
Correct REST style for endpoints?

I am trying to create an API. I am worried that the way it works right now though is bad practice. I have an endpoint that accepts get, post, patch, and delete. Is this a poor idea? I was considering replacing my current code:

router.get('/api/user', userController.readUser);

router.post('/api/user', userController.createUser);

router.patch('/api/user', userController.updateUser);

router.delete('/api/user', userController.deleteUser);

With something like:

router.get('/api/getUser', userController.readUser);

router.post('/api/addUser', userController.createUser);

router.patch('/api/updateUser', userController.updateUser);

router.delete('/api/deleteUser', userController.deleteUser);

Which style is most appropriate? Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The http method tells people that it's a get, add, update, and delete. You don't need to specify it in the url path.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda