# 關於 HTTP、HTTPS |學習筆記 ###### tags: `學習筆記`、`自學人生` ## 什麼是 HTTP ? * 超文本傳輸協定:HyperText Transfer Protocol * 電腦間相互溝通的方式,常用於網頁上 * 電腦溝通的過程: 1. 我們在 瀏覽器 收尋欄輸入網址:http://www.google.com 2. 電腦 會發送一請求與 :// 後面 www.google.com 做溝通 3. 伺服器 接收到請求並許可後,會回傳 檔案 給 電腦 4. 回傳的 檔案 經過瀏覽器解析之後,才會是我們看到的畫面(google首頁) * **ip** 是什麼? * www.google.com 這串文字都會對應到一個實體的 ip 位置 * ip就是每台電腦或伺服器的地址: 142.251.43.4 * **Http Method** : 根據不同目的的所發出的不同請求 > Get ->拿取資料 > Post ->上傳資料 > put -> 覆蓋資料 (不可局部更新) > patch -> 更新資料 (可局部更新) > Delete ->刪除資料 * **Request**: 發送請求 >start line: 寫上使用的http方法、版本與路徑 [color=#F4B400] >header: 寫上一些額外的資訊 [color=#F4B400] >body: 寫上要傳送的內容 [color=#F4B400] 範例: :::warning >Post /oscar HTTP/1.1 >Host:www.Oscar.com >User-Agent: Mozilla/5.0(window...)Chorome... >Accept: text/plain >Content-Type: text/plain >Content-Length: 43 >{"card" : 1234567890, "total_price" : 9088} ::: * **Response**: >start line: http版本、狀態碼、狀態資訊 [color=#F4B400] >header: 一些額外的資訊 [color=#F4B400] >body: 要傳送的內容 [color=#F4B400] 範例: :::warning >HTTP/1.1 200 OK >Server: nginx >Content-Type: text/plain >Content-Length: 7 >Date: Fri, 13 Aug 2023 19:09:07 GMT >success ::: * **Http Status Code**: 狀態碼 :zap: 1XX : Informational :zap: 2XX : Successful :100: :zap: 3XX : Redirects :zap: 4XX : Client Errors :zap: 5XX : Server Errors ## Https * 超文本傳輸<font color="red">**安全**</font>協定:HyperText Transfer Protocol <font color="red">**Secure**</font> * SSL/TLS 加密
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up