Building a Ballerina HTTP service
Cloud native applications depend heavily on network communications and HTTP is a widely used protocol for communicating between servers and clients. HTTP is the most common protocol used to implement web servers through various types of communication protocols. The HTTP protocol is simple by design, and it is the main protocol used in a web browser.
Network communication is a first-class concept in the Ballerina language. Ballerina has built-in HTTP libraries to support building HTTP services. Here, we discuss different ways of building an HTTP server that responds to the client with a payload.
Ballerina uses the concept called service, which is a collection of resources. Each resource has its own implementation that can be uniquely identified by a Universal Resource Locator (URL) address. A service exposes that collection of resources on a specified port. This will enable another service or client application to access these services and get...