Let us say that we need to get the weather data for my city today. To do this I will need to ask someone who knows about the weather conditions in my city. Assuming that computers are not yet available, we would typically look at the day’s newspaper or may be listen to the radio.
In this process, there are two distinct participants. First one is you, who wants the information about the weather. The second one is the Radio or Newspaper who provides the information. If we were to name these two participants we have
- Consumer who wants to consume specific information. Also, called as Client in Client-Server context.
- Provider who provides the information. Also, called as Server in Client-Server context.
HTTP Protocol between Client and Server
Further discussing the above example, we would read a newspaper or listen to the radio to get the weather updates. Newspaper and Radio use your local language and you will be able to understand what is written in the paper or spoken on the Radio. However, for the Clients and Servers on the Web we have to come up with two things
- A medium for communication, specifically a protocol for two systems to interact. Also called HTTP communication protocol
- A protocol to ask for the required details from the server. This could be in any form of formatted data. Most commonly used formats are XML and Json.
- Server responds by sending a Response in any form of formatted data, here also it could be XML or JSON.