Tom*_*meg 236
来吧伙计:)我们可以通过例子更简单地做到:
/this-is-an-endpoint
/another/endpoint
/some/other/endpoint
/login
/accounts
/cart/items
Run Code Online (Sandbox Code Playgroud)
当放在域下时,它看起来像:
https://example.com/this-is-an-endpoint
https://example.com/another/endpoint
https://example.com/some/other/endpoint
https://example.com/login
https://example.com/accounts
https://example.com/cart/items
Run Code Online (Sandbox Code Playgroud)
可以是http或https,我们在示例中使用https.
对于不同的HTTP方法,端点也可以不同,例如:
GET /item/{id}
PUT /item/{id}
Run Code Online (Sandbox Code Playgroud)
将是两个不同的端点 - 一个用于r etrieving(如"c R ud"缩写),另一个用于u pdating(如"cr U d")
这就是全部,真的那么简单!
Pau*_*man 67
到目前为止发布的所有答案都是正确的,端点只是通信渠道的一端.对于OAuth,您需要关注三个端点:
希望有助于澄清事情.玩得开心学习OAuth!如果您在实施OAuth客户端时遇到任何困难,请发布更多问题.
Cle*_*ral 14
简短的回答:“端点是对消息通道末端进行建模的抽象概念,系统可以通过该通道发送或接收消息”(Ibsen,2010)。
端点与 URI(消歧义)
端点与 URI 不同。原因之一是 URI 可以驱动到不同的端点,例如一个端点用于 GET,另一个端点用于 POST,等等。例子:
@GET /api/agents/{agent_id} //Returns data from the agent identified by *agent_id*
@PUT /api/agents/{agent_id} //Update data of the agent identified by *agent_id*
Run Code Online (Sandbox Code Playgroud)
端点与资源(消歧义)
端点与资源不同。原因之一是不同的端点可以驱动到相同的资源。例子:
@GET /api/agents/{agent_id} @Produces("application/xml") //Returns data in XML format
@GET /api/agents/{agent_id} @Produces("application/json") //Returns data in JSON format
Run Code Online (Sandbox Code Playgroud)
Ama*_*osh 11
在开放式身份验证术语中的结束点是您向其发送(POST)身份验证请求的URL.
要获得谷歌OpenID端点,通过发送GET或HEAD HTTP请求执行发现https://www.google.com/accounts/o8/id.使用GET时,我们建议将Accept标头设置为"application/xrds + xml".Google会返回包含OpenID提供程序端点URL的XRDS文档.端点地址注释为:
<Service priority="0">
<Type>http://specs.openid.net/auth/2.0/server</Type>
<URI>{Google's login endpoint URI}</URI>
</Service>
Run Code Online (Sandbox Code Playgroud)
获得Google端点后,您可以向其发送身份验证请求,指定相应的参数(在链接页面上可用).您可以通过向URL发送请求或发出HTTP POST请求来连接到端点.
术语端点最初用于 WCF 服务。后来即使这个词被用作 API 资源的同义词,REST 建议将这些 URI(理解 HTTP 动词并遵循 REST 架构的 URI[s])称为“资源”。
简而言之,资源或端点是远程托管应用程序的入口点,它允许用户通过 HTTP 协议与其通信。
该术语的端点是专注于创建请求的 URL。从不同的角度看一下下面的例子:
/api/groups/6/workings/1
/api/v2/groups/5/workings/2
/api/workings/3
Run Code Online (Sandbox Code Playgroud)
他们可以清楚地访问给定 API 中的相同源。