The World of the Internet

Francabel
4 min readMay 18, 2020

The Internet is all about communication, including how we communicate with each other, what method we use? There are many ways to do communication, however, it is chaos if everyone uses different ways. So, we need protocol to unify the format and set a standard to manage the method of communication.

Usually, in the web development field, we use HTTP protocol to communicate between the frontend side and the backend side. The browser sends a HTTP request to the server, then the server responses a html code and the browser renders the html code on user’s window. And there is a term of three-way-handshake. First of all, client will send a request and if the server feedbacks, which means the client’s delivery function and the server’s function of receive are ok. Secondly, the server will give a response and it also means the server’s delivery function is ok. Thirdly, when the client receives the response from the server, it means its function of receive is no problem.

DNS (Domain name system)

But the question is, how does the client know the server’s location? Thanks to the DNS, it can translate server’s location to IP address then send back to the client. So, the client will send the request to Google’s IP address (23.119.54.10).

HTTP Method

So far, we know how the Internet know the route between the client-side and the server-side. Now, let’s go to next page, the method.

Get==>we enter a link in the address bar, then browser sends a “get request” to the address and it will response what you need.

Post ==> we want to login our Gmail, we send account and password to Google’ server and if the account and password are verified, you can log in.

Put ==>replacing the data

Patch ==>replacing the specific data

Delete ==>deleting the data

HTTP status code (take some of them for example)

There are lots of scenarios happen when sending or receiving the data. So, we need some code to identify or classify these scenarios.

200 means successfully request

204 means there is no content to response to user’s request. For example, if a client asks to delete something, then a server just delete it without any response.

301 means the location is relocated permanently to other place.

302 means the location is relocated temporarily to other place.

400 means a server receives unexpected request and cannot response. (client-side error)

404 means the request cannot be found. (client-side error)

500 means there is an error on the server side.

TCP/IP

TCP (Transmission Control Protocol) is to manage how the data is transferred. Normally, there are two way, TCP and UDP. TCP has high reliability, so it is used for email cus if packages lose, the data or information of email is not complete. However, we use UDP for video meeting cuz even there is some packages lose, we still can see image on a screen.

IP

Static IP address, like the IP for server. It should be static and fixed.

Dynamic IP address, like the IP address for your laptop. It can be dynamic cuz there is no one links to your computer.

Port

Maybe there is a lot of service on the same server side, so we need port to identify which service we are using.

API

Application Programming Interface (API) is an interface that allows people to get your data via this interface. And of course, you can get data like weather , geolocation via this interface.

Currently, the most popular format of API is JSON. It is based on the format of JavaScript’s object.

RESTFUL API

Except SOAP, the rest of API is restful API. Like Pokemon, weather data, movie data, etc.

This article is to share some basic knowledge of the Internet and API and hoping this is helpful for you and see you next time.

Reference to Lidemy

--

--

Francabel

從業務轉換跑道,目前正朝著前端工程師邁進,寫code是生活,是工作,也是態度。轉職是一段旅行,享受旅行的過程,並指引到夢想處