我一直在阅读OAuth,它一直在谈论端点。端点到底是什么?
当前回答
到目前为止发布的所有答案都是正确的,端点只是通信通道的一端。在OAuth的情况下,有三个端点需要关注:
Temporary Credential Request URI (called the Request Token URL in the OAuth 1.0a community spec). This is a URI that you send a request to in order to obtain an unauthorized Request Token from the server / service provider. Resource Owner Authorization URI (called the User Authorization URL in the OAuth 1.0a community spec). This is a URI that you direct the user to to authorize a Request Token obtained from the Temporary Credential Request URI. Token Request URI (called the Access Token URL in the OAuth 1.0a community spec). This is a URI that you send a request to in order to exchange an authorized Request Token for an Access Token which can then be used to obtain access to a Protected Resource.
其他回答
术语的端点是用于创建请求的URL。 从不同的角度来看下面的例子:
/api/groups/6/workings/1
/api/v2/groups/5/workings/2
/api/workings/3
它们可以在给定的API中清楚地访问相同的源。
来吧,伙计们:)我们可以用例子来做得更简单:
/this-is-an-endpoint
/another/endpoint
/some/other/endpoint
/login
/accounts
/cart/items
当放在一个域中时,它看起来像:
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
可以是http或https,在本例中我们使用https。
对于不同的HTTP方法,端点也可以不同,例如:
GET /item/{id}
PUT /item/{id}
将是两个不同的端点-一个用于检索(如“cRud”缩写),另一个用于更新(如“cRud”)
就是这么简单!
到目前为止发布的所有答案都是正确的,端点只是通信通道的一端。在OAuth的情况下,有三个端点需要关注:
Temporary Credential Request URI (called the Request Token URL in the OAuth 1.0a community spec). This is a URI that you send a request to in order to obtain an unauthorized Request Token from the server / service provider. Resource Owner Authorization URI (called the User Authorization URL in the OAuth 1.0a community spec). This is a URI that you direct the user to to authorize a Request Token obtained from the Temporary Credential Request URI. Token Request URI (called the Access Token URL in the OAuth 1.0a community spec). This is a URI that you send a request to in order to exchange an authorized Request Token for an Access Token which can then be used to obtain access to a Protected Resource.
API代表应用程序编程接口。它是应用程序通过端点与其他应用程序交互的一种方式。相反,您可以为您的应用程序构建一个API,供其他开发人员通过HTTP方法使用/连接,这些方法是RESTful的。具象状态传输(REST):
GET:从API端点检索数据。 PUT:通过API更新数据——类似于POST,但更多的是更新信息。 POST:向API发送数据。 DELETE:从给定API中删除数据。 补丁:更新数据。
端点是用于与API通信的URL模式。