AnAPI proxyis a class that sits between the client and your API. It is, in essence, an API contract between you and the developers who will be using your API. So, rather than giving developers direct access to your API's backend services, which may break over time as you refactor and extend them, you provide assurance to the consumers of your API that the API contract will be honored, even when the backend services change.
The following diagram displays the communication between the client, an API proxy, the actual API being accessed, and the API's communication with the data source:
A console application that shows how easy it is to implement the proxy pattern will be programmed in this section. Our example will have an interface that will be implemented by the API and the proxy. The API will return the actual message and the proxy will obtain the message from the API and pass it to the client. Proxies can also...