
不同說明
1.GET產生一個TCP資料包,POST產生兩個TCP資料包。
2. GET請求只能進行url編碼,而POST支援多種編碼方式。
3.當瀏覽器退回時,GET是無害的。
POST將再次提交請求。
除非手動設置,否則GET請求會被瀏覽器主動cache。
實例
$("button").click(function(){
$.post("/try/ajax/demo_test_post.php",
{
name:"python學習網",
url:"http://www.xiaohonghuaw.com"
},
function(data,status){
alert("資料: n" + data + "n狀態: " + status);
});
});以上就是php中get和post的不同,希望對大家有幫助。