我的一个学校项目要求将一些AJAX请求发送到服务器的url:
http://localhost:8000/messages/:id
在这里,我应该将id的值设置为唯一数字。我知道?表示查询搜索,#正如这里提到的,但是:是什么意思? 如果我将id值设置为等于123,它的显示方式是这个 http://localhost:8000/messages/:123 ,还是 http://localhost:8000/messages/123?
任何帮助都将不胜感激!
我的一个学校项目要求将一些AJAX请求发送到服务器的url:
http://localhost:8000/messages/:id
在这里,我应该将id的值设置为唯一数字。我知道?表示查询搜索,#正如这里提到的,但是:是什么意思? 如果我将id值设置为等于123,它的显示方式是这个 http://localhost:8000/messages/:123 ,还是 http://localhost:8000/messages/123?
任何帮助都将不胜感激!
The third :
in the URL you presented is just a placeholder indicating that id
is a variable name.
Therefore, :id
must be replaced by a value, for example 123.
Your second attempt answer is correct.