什麼是endpoint

NO IMAGE

最近接觸到一個新的概念:endpoint, 是以為記

what is endpoint:

An endpoint is the ‘connection point’ of a service, tool, or application accessed over a network. In the world of software, any software application that is running and “listening” for connections uses an endpoint as the “front door.” When you want to connect to the application/service/tool to exchange data you connect to its endpoint.

Simply put, an endpoint is one end of a communication channel. When an API interacts with another system, the touchpoints of this communication are considered endpoints. For APIs, an endpoint can include a URL of a server or service. Each endpoint is the location from which APIs can access the resources they need to carry out their function.
APIs work using ‘requests’ and ‘responses.’ When an API requests information from a web application or web server, it will receive a response. The place that APIs send requests and where the resource lives, is called an endpoint.

example

endpointRESTful 風格下通常看起來是這樣:

/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 都可以,這裡只是用 http 舉例。

HTTP method不同,endpoint看起來也不一樣, 比如說:

GET /item/{id}
PUT /item/{id}

這是兩個不同的 endpoints, 一個是用於 CRUDR (Retrieving), 一個是用於 CRUDU (updating)

相關文章

TeraformABC

TDD二三事

SimpleDesign

English站會常用語