GET,POST都是向伺服器傳資料。
說get是向伺服器擷取資料,而post是向伺服器傳遞資料 其實是英文文檔翻譯的時候斷章取義了,文檔中可出這點(HTML規範在技術上定義了“GET”和“POST”之間的差別,前者意味着表單資料将(通過浏覽器)編碼成URL,而後者意味着表單資料将出現在消息正文中。但是規範也給出了使用建議,當表單處理是“幂等”時,應該使用“GET”方法,并且僅在那些情況下。作為一種簡化,我們可以說“GET”基本上是為了擷取(檢索)資料,而“POST”可能涉及到存儲或更新資料、訂購産品或發送電子郵件等任何事情。) The HTML specifications technically define the difference between "GET" and "POST" so that former means that form data is to be encoded (by a browser) into a URL while the latter means that the form data is to appear within a message body. But the specifications also give the usage recommendation that the "GET" method should be used when the form processing is "idempotent", and in those cases only. As a simplification, we might say that "GET" is basically for just getting (retrieving) data whereas "POST" may involve anything, like storing or updating data, or ordering a product, or sending E-mail.
是以一般GET使用傳個ID值給伺服器,讓伺服器通過ID取出資料,傳回給用戶端。
使用者填寫的資料,都用POST方法上傳
但是實際開發中 不用這麼細化.因為get不安全,大多都用post