JusticeTech System
Kanalga Telegram’da o‘tish
Learn to learn before you teach
Ko'proq ko'rsatishMamlakat belgilanmaganToif belgilanmagan
226
Obunachilar
-124 soatlar
-17 kun
-330 kun
Postlar arxiv
I think with these i have been able to teach you what you won't see on any book or internet
Although APIs and libraries are related, they are not the same.
Main Difference
API
An API allows different software applications to communicate. It acts like a messenger.
Example: Your weather app asks a weather server for today's forecast.
Library
A library provides ready-made code that runs inside your own application. It acts like a toolbox.
Example: Your program uses Python's math library to calculate square roots.
There are 2 types of libraries
1. Standard Library
Comes with the programming language.
2. Third-Party Library
Created by other developers.
Examples:
requests
pandas
numpy
Flask
Django
Etc
HOW LIBRARIES WORK
A library works by providing ready-made functions, classes, or modules that your program can use.
Instead of creating every feature yourself, you simply import the library and use what you need.
Real-Life Example: School Library
A school library contains thousands of books, when you need information about Biology, you don't write a new Biology textbook instead you borrow an existing one.
Programming libraries work in exactly the same way.
Instead of writing code from the beginning, developers borrow code that has already been tested.
Imagine you are building a house, would you make your own:
Bricks?
Cement?
Glass?
Roofing sheets?
No. You buy these ready-made so you can focus on building the house.
Programming works the same way.
Instead of writing code for:
Mathematical calculations
Sending emails
Drawing graphs
Connecting to the internet
Developers use libraries that already contain this code.
What is a Library?
A Library is a collection of pre-written code that programmers can reuse in their own programs instead of writing everything from scratch.
Think of it as a toolbox filled with ready-made tools. Whenever you need a tool, you simply take it from the toolbox instead of making a new one.
Simple Definition
A library is a collection of reusable code that helps programmers perform tasks more quickly and efficiently.
Final Summary
An API is a bridge that allows different software applications to communicate safely and efficiently.
Without APIs, modern apps would not be able to share data, authenticate users, process payments, display maps, or provide many of the online services we use every day.
5. Body
The body contains the main information being sent.
For example, when creating an account:
Name
Email
Password
These details are sent in the request body.
4. Headers
Headers contain extra information.
Examples:
Authentication token
Language preference
Content type
Think of headers as an ID card that identifies who is making the request.
3. Parameters
Parameters allow us to request specific information.
Example:
https://justicetech.space?city=Lagos
Here:
Parameter = city
Value = Lagos
2. URL or Base Url
A URL tells the browser or app where to find a resource.
Example:
https://api.justicetech.space/users
1. Endpoint
An endpoint is the address where an API can be reached.
Example:
https://api.justicetech.space/current
Another Example: WhatsApp
You type:
Hello
Your phone sends the message to the WhatsApp server through its API.
The server stores it and delivers it to your friend's phone.
All this usually happens in less than a second.
Client (Phone/App)
▼
Request
▼
API
▼
Server
▼
Response
▼
Client Displays Result
