参数传递
- 路径参数:通过URL的路径部分来传递,通常以
/
为分隔,并使用占位符来表示参数的值
例如:http://example.com/users/{userId}
- 查询参数(Query
Parameters):通过URL的查询字符串部分来传递,以
?
为开头,多个参数之间用&
分隔
例如:http://example.com/users?name=John&age=25
/
为分隔,并使用占位符来表示参数的值例如:http://example.com/users/{userId}
?
为开头,多个参数之间用&
分隔例如:http://example.com/users?name=John&age=25