Web developers: Why would an API use these two URLs differently????馃

Oct 2, 2026 路 5:21 AM UTC

5
1
11
850
Sort replies: Relevant Recent Liked
Replying to @Officially_Dev_
Because the API is probably treating them as different routes or parameters
1
1
87
Exactly 馃挴馃憣馃憣
46
Replying to @Officially_Dev_
I'm not a web developer
1
1
16
Replying to @Officially_Dev_
Path and query params
1
2
55
Correct. /users/52 uses a path parameter, while /users?id=52 uses a query parameter. Both can fetch the same user, but path parameters are the usual choice for identifying a specific resource, and query parameters are more common for filters or optional data.
1
1
49
Replying to @Officially_Dev_
agree with bro
Replying to @Officially_Dev_
Because the API is probably treating them as different routes or parameters
1
1
27
Replying to @Officially_Dev_
Path param vs query param. The right cenario for me: path param -> You are fetching specific resource by id. Query param is for search by "like or includes" not equals (for me)
8