Today i learned about fetch API in javascript and other network protocols.

what is API?

Application Programming Interface(API)  are a type of 
  software interface that enables applications to exchange 
  data,features, and functionality.

Types of APIs

Public APIs: Open APIs that are available to any business or developer.
Partner APIs: Only available to authorized businesses and developers.
Private APIs: Only accessible by one private enterprise.
Composite APIs: An aggregate of multiple APIs. (E.g.E-commerce checkout: Purchasing an item on Amazon involves multiple steps (adding to cart, checkout, payment) that are handled by a composite API in a single transaction.)

  • URI VS URL

    uniform resource identifiers (URIs) and uniform resource
    locators (URLs) aren't the same. A URI can be a name, a
    location, or both, while a URL specifies just the location of
    a resource.

Image description

  • FETCH (fetch is a concept or function) Fetch API is a specific JavaScript interface used to make HTTP requests to access data from APIs or other network resources.

The fetching process,
Image description

REST API

  • REST stands for Representational State Transfer and API stands for Application Program Interface. REST is a software architectural style that defines the set of rules to be used for creating web services.

  • It allows requesting systems to access and manipulate web
    resources by using a uniform and predefined set of rules.

Image description

  • http headers

    HTTP headers contain metadata in key-value pairs that are sent along with HTTP requests and responses. They can be used to define caching behavior, facilitate authentication, and manage session state.

  • https status code

    HTTP status codes are three-digit codes that indicate the
    outcome of an API request. They are included in the API's
    response to the API client.

Image description