weixin_33749131 2017-08-29 09:32 采纳率: 0%
浏览 500

URL中的“:”是什么意思?

我的一个学校项目要求将一些AJAX请求发送到服务器的url:

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

在这里,我应该将id的值设置为唯一数字。我知道?表示查询搜索,#正如这里提到的,但是:是什么意思? 如果我将id值设置为等于123,它的显示方式是这个 http://localhost:8000/messages/:123 ,还是 http://localhost:8000/messages/123?

任何帮助都将不胜感激!

  • 写回答

2条回答 默认 最新

  • weixin_33696106 2017-08-29 09:37
    关注

    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.

    评论

报告相同问题?