If the answer is No one. Then this blog is for U. I'm going to put all the things I know in Java
Things you should know before learning J2EE are inserted into this post. Hope you like it.
TCP is responsible for making sure a file sent from one network node to another ends up as a complete file at the destination, even though another on their way to destination.
HTTP is another network protocol that has web-specific features, but it depends on TCP/IP to get the complete request and response from one place to another. The structure of an HTTP conversation is a simple Request/Response sequence; a browser requests and a server responds.
A HTTP response can contain HTML. HTTP adds header information to the top of whatever content is in the response(in other words, the thing coming back from the server). An HTML browser uses the header info to help process the HTML Page.
The first thing you’ll find is an HTTP method name. These aren’t java methods, but the idea is similar. The method name tells the server the kind of the request that’s being made, and how the rest of the message will be formatted. The HTTP protocol has several methods, but the one’s you will use most often are GET and POST. (More details about request is in the rest of the post ).
–> GET is a simple request, POST can send user data.
GET is the simplest HTTP method, and its main job in life is to ask the server to get a resource and send it back. That resource might be a HTML page, a JPEG, a PDF etc. Doesn’t matter. The point of GET is to get something back from the server.
POST is a more powerful request. It’s like a GET Plus Plus. With POST, you can request something and at the same time send form data to the server.
Other HTTP methods:
Reasons why you use POST instead of GET include:
It’s true that you can send a little data with the HTTP GET. But you might not want to because,
In Depth of HTTP Request:
Any HTTP method request contains 3 parts.
The path to the resource and any parameters added to the URL are all included on the request line
Here GET is the HTTP method
/select/selectTaste.jsp — is the path to the resource on the web server
?color=dark&taste=malty — in a GET request, parameters if any are appended to the first part of the request URL, starting with a “?”. Parameters are separated with an ampersand “&”
HTTP/1.1 — The protocol version that the web browser is requesting.
Request Header contains all the data of the user client(browser)
Host : wickedlysmart.com
user-Agent: Mozilla/5.0(Macintosh,U,PC Mac OS X Mach-o;en-US;vv:1.4)Gecko/200356 NetScape/7.1
Accept language: en-US;q = 0.5
Accept Encoding : gzip,deflate
Keep Alive :300
Don’t Worry. These are all the things that we hardly care about.
Just have glimpse at them, so that we can get to know these are all the things that our browser sends to the server when we request for something on the website by clicking (or) typing (or) by some other sort of thing in request header.
When the request method type is POST, the browser send the user details in the request body.
Like for example:
When we fill a form in a website and clicks on submit button, the the entered details are sent through the request body. Because the form details may be very big and the request line only allows us to append 255 characters and also for some security issues.
The request body is optional. If the HTTP method is POST, then the request body is used to the send the user entered parameters to the server.
In Depth of HTTP Response:
Any HTTP method response contains 3 parts.
The HTTP response line contains the protocol version that the web server is using, HTTP status code for the response, A text version of the status code.
example: HTTP/1.1 200 OK
HTTP/1.1 — is the protocol version that the web server is using
200 — is the status code
OK — text version of the status code.
Response header contains the details about the server and the data that the server is sending.
set-Cookie : JSESSIONID = 0AAB6C8DE415; path=/testEL
content-Type : text/html
content-Text : 397
Date: thu 23 AUG 2012 03:25:40 GMT
Server : Apache- Coyote/1.1
No need to remember all these.
These are all the things that we hardly care about.
Just have glimpse at them, so that we can get to know these are all the things that server sends to the browser in request header.
The content- Type in the response header’s value is known as MIME type. The MIME Type tells the browser what kind of data the browser is about to receive. So that the browser will know how to render it.
Notice that the MIME type value relates to the value listed in the HTTP request’s “Accept” header(Go look at the Accept Header from the request header)
It is where the actual data that we looking for lies. The server sends the data, and the browser renders the data by looking into the response body
That’s it. Hope you like it. Thanks for reading. Thanks for your time.