A way 2 software communicate with each other over a network.
-
- IP (Internet Protocol)
-
- TCP (Transmission Dontrol Protocol)
- UDP (User Datagram protocol)
-
- HTTP (Hypertext transfer protocol) 80
- HTTPS (Hypertext transfer protocol secure) 443
- WS (Websocket) 80
- WSS (Websocket secure) 443
- FTP (File Transfer Protocol) 21
- DNS (Domain Name System) 53
Endpoint to communicate with a software.
Resolves a name to IP address
https://wwww.nodejs.org:443/en/docs?search=api
- https -> Scheme/Protocol
- wwww.nodejs.org -> Domain
- org -> Top Level Domain (TLD)
- nodejs -> Main Domain
- wwww -> Sub Domain
- 443 -> Port
- /en/docs -> Path
- en -> Folder
- docs -> Folder
- search=api => URL Parameters / Query
- Text => text/plain
- HTML(Hypertext Markup Language) => text/html
- XML (Extensible Markup Langauge) => application/xml
<xml> <user> <name>Bhaktij Koli</name> <email>hello@bhaktijkoli.com</email> </user> </xml>
- JSON(JavaScript Object Notation) => application/json
{ "name" "Bhaktij Koli", "email: "hello@bhaktijkoli.com" }
- Multimedia (File, Image, etc)
-
- Limited to XML
- Strict
-
- XLL, JSON, text, html, images, videos, files
-
- Event Driven (Eg: socket.io)
- Pub/Sub (Eg: IOT)
-
- GRPC(Google Remote Procedure Call)
-
- Apollo
- Helix
- Yoga
- AWS Amplify
-
- URL
- Method
- Headers
- Body
-
- Status Code
- Headers
- Body
- GET (Fetch Data)(No Request Body)
- POST (Create Data)
- PUT (Update Data by replacing it)
- DELETE (Delete Data)
- PATCH (Update/Repair Data without replacing it)
- HEAD (Fetch Headers)(No Response Body)
- CONNECT (Eastablish Connection)(No Request Body)
- OPTIONS (To check for available options)(No Request Body)
- TRACE (Trace)
To add additional info or to describe to the request
- Accept
- Authorization
- Content-Type
- Cookie
- Origin
- Custom Headers (start with X)
- X-Powered-By
- Sucessful Response
- 200 (OK)
- Redirect Response
- 301
- Client Error Response
- 400 (Bad Request)
- 401 (Not Authenticated)
- 403 (Forbiden)
- 404 (Not Found)
- 405 (Not Authorized)
- Server Error Response
- 500 (Internal Server Error)
- Maintain client side
- Maitain server side
Access-Control-Allow-Origin: '*' Access-Control-Allow-Methods: 'GET,POST', Access-Control-Allow-Headers: