iamvince24 / Journal

This Repo is used to record some learning and notes. I will write some notes as an article to record here Zenn.
0 stars 0 forks source link

[NET101] 網路基礎概論 筆記 #5

Open iamvince24 opened 11 months ago

iamvince24 commented 11 months ago

前言:內容為 [NET101] 網路基礎概論(搭配 JS 實作練習) 的筆記

為什麼我們需要協定(protocol)?

HTTP 是個什麼玩意兒?

HTTP request 的一生

我只是個計程車司機:DNS Server

永遠不要忘記瀏覽器只是另一個程式

Header 與 Body(不是網頁的那個)

GET 與 POST

其他的 HTTP Method

The HEAD method asks for a response identical to a GET request, but without the response body.

常見的 HTTP Status code

實作一個超簡易 HTTP Server

var http = require('http')

var server = http.createServer(function(req, res){
    console.log(req.url)

    if (req.url === '/'){
        res.write('welcome')
        res.end()
        return
    }

    if (req.url === '/hello'){  
        res.write('hello')
        res.end()
        return
    }

    if (req.url === '/redirect'){   
        res.writeHEAD(200, {
            'Location': '/hello'
        })
        res.end()
        return
    }

    res.writeHEAD(404)
    res.end()
})

server.listen(5000)

TCP / IP 是個什麼玩意兒?

IP 地址

虛擬 IP、浮動 IP 與固定 IP

Port 連接埠(端口)的作用

TCP 與 UDP

淺談三次握手

總結


API 是什麼?為什麼需要它?

API 與 Web API

串接 HTTP API 實戰


純文字與自定義格式

XML

JSON (JavaScript Object Notation)

SOAP 簡介(Simple Object Access Protocol)

什麼叫做「其他的」API?

RESTful 到底是什麼?

API 串接實戰

自定義資料交換

必學指令:curl

ping, telnet 與 nslookup

看穿網路的本質,才能不被迷惑