首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >BindingSource.Path与BindingSource.Query的区别

BindingSource.Path与BindingSource.Query的区别
EN

Stack Overflow用户
提问于 2018-07-12 11:54:55
回答 1查看 59关注 0票数 0

BindingSource.PathBindingSource.Query有什么区别?

从看起来非复杂值默认为BindingSource.Path,但我不能真正理解两者之间的区别。

代码语言:javascript
复制
[HttpGet("{id}")]
public ActionResult<string> Get(int id) // id = BindingSource.Path
{
    return "value";
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-07-12 12:10:32

来自文档

BindingSource.Path:请求url路径的BindingSource

URL路径通常采用[controller]/[action]/{id?}格式

BindingSource.Query:请求查询-字符串的BindingSource

带有查询字符串的URL通常采用[controller]/[action]?parameterName=parameterValue格式。

作为例子:

  • BindingSource.Pathhttp://localhost:1234/api/test/1
  • BindingSource.Queryhttp://localhost:1234/api/test?id=1
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51305026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档