Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this a bad REST URL?

Tags:

rest

I've just been reading about REST URLs and seen the following example:

/API/User/GetUser

Now if this is accessed over HTTP with a verb GET isn't this a bad URL becuase it describes the action (GET) in the URL?

like image 820
AwkwardCoder Avatar asked Nov 29 '22 11:11

AwkwardCoder


1 Answers

It's more of a convention, than a hard rule, but I would rather see something like /API/User/7123. The GET/POST/etc describes the action verb, so also putting it in the url makes it redundant. And in this situation there's no reason not to follow good proven practices.

Here's some good stuff: Understanding REST: Verbs, error codes, and authentication

like image 136
adamJLev Avatar answered Feb 24 '23 10:02

adamJLev