What does the ":" mean in the url?

Some requirement in my school project asks to send some AJAX request to the server at the URL:

http://localhost:8000/messages/:id

where should I set the id value as a unique number. I know what ?search query means and #as mentioned here , but what does it mean :? and if I set the id value to 123, as shown, for example: http://localhost:8000/messages/:123 or like this:http://localhost:8000/messages/123

I appreciate any help

+4
source share
2 answers

The third :in the URL you submit is just a placeholder indicating what the idvariable name is. Therefore, :idit is necessary to replace with a value, for example 123.

.

+1

URL- ':'. , . host:port - localhost, - 8000.

, ': id', , id . , "123". , url (../messages/id) (../messages/:id).

: .

+1

Source: https://habr.com/ru/post/1684661/


All Articles