Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!