Академический Документы
Профессиональный Документы
Культура Документы
LEARNING OBJECTIVE
Communication web browser and web Html file, picture,window file .exe and
servers anything (represent in bytes)
HTTP
HYPERTEXT TRANSFER
PROTOCOL
3. The server sends a response to the client. The response begins with
a response code, followed by a header full of metadata, a blank line,
and the requested document or an error message.
When this request message reaches the server, the server can take either one of
these actions:
1. The server interprets the request received, maps the request into a file under
the server's document directory, and returns the file requested to the client.
2. The server interprets the request received, maps the request into a program
kept in the server, executes the program, and returns the output of the
program to the client.
3. The request cannot be satisfied, the server returns an error message.
REQUEST BODY
POST /cgi-bin/register.pl HTTP 1.0
Date: Sun, 27 Apr 2013 12:32:36
Host: www.cafeaulait.org
Content-type: application/x-www-form-urlencoded
Content-length: 54
username=Elliotte+Harold&email=elharo%40ibiblio.org
1. A starter line including the method, path and query string, and HTTP version
2. An HTTP header
3. A blank line (two successive carriage return/linefeed pairs)
4. The body
RESPONSE BODY
HTTP/1.1 200 OK The browser receives the
response message,
Date: Sun, 18 Oct 2009 08:56:53 GMT
interprets the message and
Server: Apache/2.2.14 (Win32) displays the contents of the
Last-Modified: Sat, 20 Nov 2004 07:16:26 GMT message on the browser's
ETag: "10000000565a5-2c-3e94b66c2e680" window according to the
Accept-Ranges: bytes media type of the response
(as in the Content-Type
Content-Length: 44
response header). Common
Connection: close media type include
Content-Type: text/html "text/plain", "text/html",
X-Pad: avoid browser bug "image/gif", "image/jpeg",
<html><body><h1>It works!</h1></body></html> "audio/mpeg",
"video/mpeg",
"application/msword", and
"application/pdf".
EXERCISE
1. HTTP is stand for ______________________________________
A. Hypertext protocol
B. Hypertext markup protocol
C. Hypertext Technology Protocol
D. Hypertext Transfer Protocol
Short question:
1. What is mean by idempotent?
2. Give at least 2 difference between http 1.0 and http 1.1?
COOKIES
Example of COOKIES
An HTTP cookie (web cookie, browser cookie)
is a small piece of data that a server sends to
the user's web browser
the server doesnt reuse cookies, this enables it to track individual users
and sessions across multiple,
After installing a CookieManager with those two lines of code, Java will
store any cookies sent by HTTP servers you connect to with the URL
class, and will send the stored cookies back to those same servers in
subsequent requests