Search Options
close
Search the following clips:
All Clips
news
science
politics
food
economy
art
technology
health
internet
religion
psychology
Sign Up
Install
Learn More
Login
post&get
niufangxing
follow
0
9-22-2009 9:21 AM
21 views
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
Wacky Winter Weather
It's always the woman holding you back
Pet Tarantula makes eye contact with owner
Humans 'Have Six-hour Window' to Erase Memories of Fear
This Back Flip Attempt Never Had A Chance [GIF]
Men and sex: nature or excuse?
Cute yawning animals
Global Warming Nonsense Coming to an End
Kseniya Simonova - Sand Animation - Absolutely beautiful, must see
No Blasphemy in Ireland
visit the
Top Clips page
View the Top Clips from
September 22, 2009
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/54b903ca-98bc-44e8-948a-fd52498e9a60/BE044C85-97D1-4951-A7B8-6F36336BCF3C/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html" href="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html" style="font-size: 11px;">www.cnblogs.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html"><P> (1).所谓安全的意味着该操作用于获取信息而非修改信息。换句话说,GET 请求一般不应产生副作用。就是说,它仅仅是获取资源信息,就像数据库查询一样,不会修改,增加数据,不会影响资源的状态。</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html"><P> <SPAN><SPAN><B>2</B></SPAN>.</SPAN><SPAN>根据HTTP规范,POST表示可能修改变服务器上的资源的请求</SPAN>。继续引用上面的例子:还是新闻以网站为例,读者对新闻发表自己的评论应该通过POST实现,因为在评论提交后站点的资源已经不同了,或者说资源被修改了。</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html"><P> <SPAN><B>1</B></SPAN>.GET请求的数据会附在URL之后(就是把数据放置在HTTP协议头中),以?分割URL和传输数据,参数之间以&相连,如:login.action?name=hyddd&password=idontknow&verify=%E4%BD%A0%E5%A5%BD。如果数据是英文字母/数字,原样发送,如果是空格,转换为+,如果是中文/其他字符,则直接把字符串用BASE64加密,得出如:%E4%BD%A0%E5%A5%BD,其中%XX中的XX为该符号以16进制表示的ASCII。</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html"><P> <SPAN><B>4</B></SPAN>.POST的安全性要比GET的安全性高。注意:这里所说的安全性和上面GET提到的“安全”不是同个概念。上面“安全”的含义仅仅是不作数据修改,而这里安全的含义是真正的Security的含义,比如:通过GET提交数据,用户名和密码将明文出现在URL上,因为(1)登录页面有可能被浏览器缓存,(2)其他人查看浏览器的历史纪录,那么别人就可以拿到你的账号和密码了,除此之外,使用GET提交数据还可能会造成Cross-site request forgery攻击。</P></blockquote><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content6.clipmarks.com/images/clip-icon.gif" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://my.9sky.com/435200827/Index" href="http://my.9sky.com/435200827/Index" style="font-size: 11px;">my.9sky.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://my.9sky.com/435200827/Index"><div align="center"><img src="http://content7.clipmarks.com/blog_cache/my.9sky.com/img/2946C543-BFB3-4057-8C17-C52CAC04041D" alt="" /></div></blockquote><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content8.clipmarks.com/images/clip-icon.gif" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html" href="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html" style="font-size: 11px;">www.cnblogs.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html"><P> (2).幂等的意味着对同一URL的多个请求应该返回同样的结果。这里我再解释一下<B><SPAN>幂等</SPAN></B>这个概念:</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html"><SPAN><SPAN><B>1</B></SPAN>.根据HTTP规范,GET用于信息获取,而且应该是安全的和幂等的</SPAN></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html"><P> 总结一下,<SPAN>Get</SPAN>是向服务器发索取数据的一种<SPAN>请求</SPAN>,而<SPAN>Post</SPAN>是向服务器提交数据的一种<SPAN>请求</SPAN>,在FORM(表单)中,Method默认为"GET",实质上,GET和POST只是发送机制不同,并不是一个取一个发!</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html">到这里,大家应该有个大概的了解了,GET一般用于<SPAN>获取/查询</SPAN>资源信息,而POST一般用于<SPAN>更新</SPAN>资源信息。</blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/BE044C85-97D1-4951-A7B8-6F36336BCF3C/blog/" title="blog or email this clip"><img src="http://content9.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK