DEV Community· Labby·· 1 小時前AI 評分33
網址列與頁面之間會發生甚麼事?
What happens between the address bar and the page?
AI 導讀
教學引導讀者觀察瀏覽器如何透過網址中的主機名稱和路徑尋找伺服器,以及伺服器回傳的內容。回傳 404 代表請求已收到 HTTP 回應;若瀏覽器無法解析主機名稱,則要找出流程在哪裏中斷。
正文
AI-assisted tutorial.
Pick a page you visit all the time. Before you open it, try to name the host and path in its URL. Then watch how the browser finds the server and what comes back.
A quick check after watching: a page that returns 404 got far enough to receive an HTTP response. Where did things stop if the browser couldn't resolve the host?
來源:DEV Community · dev.to