What is Protocol, HTTP, REST, API, REST API, JSON, XML, and how they are related?

Mikayel Dadayan
4 min readMay 9, 2022

The goal of this article is to understand these concepts and how they are related. In this article, you can find a brief introduction and determination of what is Network Protocol, HTTP, REST, API, RESTFUL API, JSON XML, and SOAP.

What is NETWORK PROTOCOL?
The network protocol is a set of rules and conventions that networking devices should follow (like computers) to share data effectively.

HTTP (HyperText Transfer Protocol)
HTTP(Hypertext Transfer Protocol) is the set of rules for transferring files (text, images, audio, video, …) over the network. Whenever we open our web browser, we are indirectly using HTTP. HTTP is an application protocol that runs on top of the TCP/IP suite of protocols, which forms the foundation of the internet.
- HTTP is an application layer protocol for sending and receiving messages over the network.
- In HTTP we can use the GET method for all sorts of interactions.
- HTTP is a stateless protocol, which means each request is independent from the other requests.

REST (REpresentational State Transfer)
REST (REpresentational State Transfer) is an architectural style for developing web services. REST is popular due of its simplicity and the fact that it builds upon existing systems and features of the internet’s Hypertext Transfer Protocol (HTTP).
- REST is a way to implement and use the HTTP protocol.
- REST is a specification that dictates how distributed systems on the web should communicate.
- Simply to say REST is a series of rules in place for our server, so that everyone that uses our server can understand what it does and how it works.

REST should answer 2 questions:
1. Method information: The method information should be expressed in the HTTP verb

2. Scoping Information: Scoping information should be in the URI

API (Application Programming Interface)
An application program interface (API) is code that allows two software programs to communicate with each other. An API defines the correct way for developers to request services from an operating system(OS) or other application, and expose data within different contexts and across multiple channels.
- API is a software intermediary that allows two applications to talk to each other.
- So an API could be anything in any form. The only thing that it has to be is that it has to be a way to communicate with a software component.

How do APIs relate to Web Services?
- APIs are for software components, a way for software to interact with other software.
- The way an API is implemented and what it consists of is not important
- Web Services are a set of rules and technologies that enable two or more components on the web to talk to each other.

RESTful API
A RESTful APIis an architectural style for an application program interface that uses HTTPrequests to access and use data. That data can be used to GET, PUT, POST, and DELETE data types, which refers to the reading, updating, creating, and deleting of operations concerning resources.
- It uses HTTP methods suitably (GET for getting data, POST for creating, …).
- Scoping information (and other data) goes in the parameters part of the URI.
- It uses common data formats (most commonly JSON).
- Communication is stateless.

JSON (JavaScript Object Notation)
- JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
- A JSON object is a key-value data format that is typically rendered in curly braces.
- JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

XML (Extensible Markup Language)
- XML (Extensible Markup Language) is a markup language similar to HTML, but without predefined stages to use. Instead you define your own tags designed specifically for your needs. This is a powerful way to store data in a format that can be stored, searched, and shared.
- Most importantly, since the fundamental format of XML is standardized, if you share or transmit XML across systems or platforms, either locally or over the internet, the recipient can still parse the data dues to the standardized XML syntax.

--

--