http中get和post能否同时使用

用post请求的话,可以和get一起使用,但是如果用get请求提交的话,会用form里面的参数替换掉地址栏原有参数,有冲突

 get产生一个数据包,post产生两个数据包

 1.url中用get添加参数,表单用get提交

如下所示,表单采用get方法,url中的参数urlpara会被覆盖掉。实际提交的链接为
https://www.runoob.com/try/demo_source/www.baidu.com?user=zhangsan&password=123

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="www.baidu.com?urlpara=3", method="get">
Username: <input type="text" name="user"><br>
Password: <input type="password" name="password">
    <input type="submit" name="password">
</form>

<p><b>注意:</b>用post请求的话,可以和get一起使用,但是如果用get请求提交的话,会用form里面的参数替换掉地址栏原有参数,有冲突
</p>

</body>
</html>

2. url用get,表单用post

url中的参数还保留着
https://www.runoob.com/try/demo_source/www.baidu.com?urlpara=3
原文地址:https://www.cnblogs.com/sunupo/p/13416456.html