博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
get方法与post方法的使用
阅读量:6278 次
发布时间:2019-06-22

本文共 2884 字,大约阅读时间需要 9 分钟。

使用get方法获取页面的form内容

新建一个getform.html 

        Using Http Get Method            
First Name :
Last Name :
Email-Id :
Password:

新建一个Receiving_Get_Form.aspx页面

<%@ page language="C#" AutoEventWireup="true" codeFile="Receiving_ Get_Form.aspx.cs" Inherits="Receiving_ Get_Form"% >            Data Received Here             
First Name : <% Response.Write(Page.Request.QueryString["F_name"]); %>
Last Name : <% Response.Write(Page.Request.QueryString["L_name"]); %>
Email-Id : <% Response.Write(Page.Request.QueryString["E_mail"]); %>
Password : <% Response.Write(Page.Request.QueryString["P_word"]); %>
  1.  GET - Requests data from a specified resource

  2. An hyperlink or anchor tag that points to an action will ALWAYS be an HttpGet.

  3. Data is submitted as a part of url.

  4. Data is visible to the user as it posts as query string.

  5. It is not secure but fast and quick.

  6. It use Stack method for passing form variable.

  7. Data is limited to max length of query string.

  8. It is good when you want user to bookmark page.

 

使用post获取表单内容

        
First Name :
Last Name :
Email-Id :
Password:
<%@ page language="C#" AutoEventWireup="true" codeFile="Receiving_Post_Form.aspx.cs" Inherits=" Receiving_Post_Form"% >            Data Received Here             
First Name : <% Response.Write(Page.Request.Form["F_name"]); %>
Last Name : <% Response.Write(Page.Request.Form["L_name"]); %>
Email-Id : <% Response.Write(Page.Request. Form["E_mail"]); %>
Password : <% Response.Write(Page.Request. Form["P_word"]); %>
  1. POST - Submits data to be processed to a specified resource

  2. A Submit button will always initiate an HttpPost request.

  3. Data is submitted in http request body.

  4. Data is not visible in the url.

  5. It is more secured but slower as compared to GET.

  6. It use heap method for passing form variable

  7. It can post unlimited form variables.

  8. It is advisable for sending critical data which should not visible to users.

 

转载于:https://www.cnblogs.com/Hackerman/p/4772003.html

你可能感兴趣的文章
检验手机号码
查看>>
重叠(Overlapped)IO模型
查看>>
Git使用教程
查看>>
使用shell脚本自动监控后台进程,并能自动重启
查看>>
Flex&Bison手册
查看>>
solrCloud+tomcat+zookeeper集群配置
查看>>
/etc/fstab,/etc/mtab,和 /proc/mounts
查看>>
Apache kafka 简介
查看>>
socket通信Demo
查看>>
技术人员的焦虑
查看>>
js 判断整数
查看>>
建设网站应该考虑哪些因素
查看>>
mongodb $exists
查看>>
js实现页面跳转的几种方式
查看>>
sbt笔记一 hello-sbt
查看>>
常用链接
查看>>
pitfall override private method
查看>>
!important 和 * ----hack
查看>>
聊天界面图文混排
查看>>
控件的拖动
查看>>