post and get methods
DESCRIPTION
Post and get methodsTRANSCRIPT
Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
Week Target Achieved
1 40 23
2 40 27
3 40 28
Typing Speed
Jobs AppliedWeek Company Designation Applied Date Current Status
1 Intel info group System Engineer 16-9-2013 Short listed
2 Alcatel-lucent Software Engineer 10-9-2013 Waiting
3
POST and GET methods
Muhammed Noufal V [email protected]
mwww.facebook.com/vtnoufalvttwitter.com/noufalurnappyin.linkedin.com/pub/
muhammed-noufal9744003056
Request-Response Cycle
• When enter an address (URL) into the address bar of a web browser or click on a link, we generate a request for a file
• The request is routed to a Web server, which sends back a response, usually an HTML page
URLWeb
Browser
request
responseHTML, images, files
WebServer
Get Method
• Send parameters in the URL http://localhost:8081/fstpro/sec.jsp?name=sonia
• sec.jsp
<%session.setAttribute("name",request.getParameter("name"));
session.setAttribute("age",request.getParameter("age"));session.setAttribute("sex",request.getParameter("sex"));%>
• The amount of information you can send back using a GET is restricted as URLs can only be 1024 characters.
HTML Forms
• Send parameters via forms <FORM ACTION="printname.jsp" METHOD="get"> <INPUT TYPE="text" NAME="firstname" SIZE=40> <INPUT TYPE="submit" value="Print Name"> </FORM>
• Access these with the request object
<% String name = request.getParameter("firstname"); . . . %>
Post Method
• Post attaches parameter values to request
• A POST on the other hand will (typically) send the information through a socket back to the webserver and it won't show up in the URL bar.
• You can send much more information to the server this way - and it's not restricted to textual data either.
Get & Post
• Get puts parameters and values in the URL page.jsp?param1=value1¶m2=value2&...– Send with a link or in a form with method="get"
• Post attaches parameters to request– Send in a form with method="post“
GET POST• Parameters encoded in URL attached to
request• data limit URL length no limit• Bookmarks yes no
Contact Us
Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
Start up VillageEranakulam,Kerala, India.
Email: [email protected]