0

What's the difference between the following 2? /customers/{customerId} and /customers?id={customerId} ?

Which one is better? Which one is more secure?

  • 1
    First one is a path parameter, second one a query parameter. See for example [When do I use path params vs. query params in a RESTful API?](https://stackoverflow.com/questions/30967822/when-do-i-use-path-params-vs-query-params-in-a-restful-api) – pzaenger Oct 30 '21 at 00:30
  • 1
    Does this answer your question? [When do I use path params vs. query params in a RESTful API?](https://stackoverflow.com/questions/30967822/when-do-i-use-path-params-vs-query-params-in-a-restful-api) – Ken White Oct 30 '21 at 00:36
  • Thanks. That's a great summary. I'm new to stackoverflow. How can I mark your answer as the solution? – abcdefq355 Oct 30 '21 at 00:37

0 Answers0