HTTP or HTTP/2: Difference between revisions

From Computer Science Wiki
(Created page with "<center> <blockquote style="padding: 5px; background-color: #FFF8DC; border: solid thin gray;"> File:Exclamation.png This is student work which has not yet been approve...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 8: Line 8:


== Introduction ==
== Introduction ==
Hypertext Transfer Protocol is a communications protocol. It is used to send and receive webpages and files on the internet. It was developed by Tim Berners-Lee and is now coordinated by the W3C. HTTP version 1.1 is the most common used version today. It is defined in RFC 2616.<ref>https://computersciencewiki.org/index.php?title=HTTP_or_HTTP/2&action=edit</ref>


Please write a clear, concise description of your topic here.You will likely reference your introduction from somewhere else. Please use the following syntax at the end of each of your ideas. '''IT IS CRITICAL YOU ATTRIBUTE''' others work. Your introduction should be factual. No more than 3 or 4 sentences, please. Because you are not an expert in your topic, I expect you to triangulate your information. LOTS OF LINK TO OTHER RESOURCES PLEASE! If you do not use a section, please delete it. Your finished page should only have information which explains your topic.  
== How it works ==
HTTP works by using a user agent to connect to a server. The user agent could be a web browser or spider. The server must be located using a URL or URI. This always contains http:// at the start. It normally connects to port 80 on a computer.


== Difference between HTTP and HTTPS ==
A more secure version of HTTP is called HTTPS (Hypertext Transfer Protocol Secure). This contains https:// at the beginning of the URL. It encrypts all the information that is sent and received. This can stop malicious users such as hackers from stealing the information and is often used on payment websites. HTTPS uses port 443 for communication instead of port 80<ref>https://computersciencewiki.org/index.php?title=HTTP_or_HTTP/2&action=edit</ref>
== Request message ==
The request message contains the following:
* Request line, such as <nowiki>GET /images/logo.gif HTTP/1.1</nowiki>, which requests the file <nowiki>logo.gif</nowiki> from the <nowiki>/images</nowiki> directory
* Headers, such as Accept-Language: en
* An empty line
* An optional message body
The request line and headers must all end with two characters: a carriage return followed by a line feed, often written <CR><LF>. The empty line must consist of only <CR><LF> and no other whitespace. In the HTTP/1.1 protocol, all headers except Host are optional.
A request line containing only the path name is accepted by servers to maintain compatibility with HTTP clients before the HTTP/1.0 standard.
== Example session ==
Below is a sample conversation between an HTTP client and an HTTP server running on www.example.com, port 80. As mentioned in the previous sections, all the data is sent in a plain-text (ASCII) encoding, using a two-byte CR LF ('\r\n') line ending at the end of each line.
<b>Client request</b>
  <nowiki>
  <nowiki>
  <ref>the url I cited by material from</ref>
  GET /index.html HTTP/1.1
Host: www.example.com
  </nowiki>
  </nowiki>
A client request (consisting in this case of the request line and only one header field) is followed by a blank line, so that the request ends with a double newline, each in the form of a carriage return followed by a line feed. The "Host" field distinguishes between various DNS names sharing a single IP address, allowing name-based virtual hosting. While optional in HTTP/1.0, it is mandatory in HTTP/1.1.


== How does it work or a deeper look ==
<b>Server response</b>
<nowiki>
HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 138
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
ETag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Connection: close


* If you are discussing a THING YOU CAN TOUCH, you must explain how it works, and the parts it is made of. Google around for an "exploded technical diagram" of your thing, [http://cdiok.com/wp-content/uploads/2012/01/MRI-Technology.jpg maybe like this example of an MRI]  It is likely you will reference outside links. Please attribute your work.
<html>
* If you are discussing a PROCESS OR ABSTRACT CONCEPT (like [[fuzzy logic]]) you must deeply explain how it works.
<head>
 
  <title>An Example Page</title>
== Examples ==
</head>
<body>
  Hello World, this is a very simple HTML document.
</body>
</html>
</nowiki>


Please include some example of how your concept is actually used. Your example must include WHERE it is used, and WHAT IS BENEFIT of it being used.
he ETag (entity tag) header field is used to determine if a cached version of the requested resource is identical to the current version of the resource on the server. Content-Type specifies the Internet media type of the data conveyed by the HTTP message, while Content-Length indicates its length in bytes. The HTTP/1.1 webserver publishes its ability to respond to requests for certain byte ranges of the document by setting the field Accept-Ranges: bytes. This is useful, if the client needs to have only certain portions[34] of a resource sent by the server, which is called byte serving. When Connection: close is sent, it means that the web server will close the TCP connection immediately after the transfer of this response.


== Pictures, diagrams ==
Most of the header lines are optional. When Content-Length is missing the length is determined in other ways. Chunked transfer encoding uses a chunk size of 0 to mark the end of the content. Identity encoding without Content-Length reads content until the socket is closed.


Pictures and diagrams go a LONG way to helping someone understand a topic. Especially if your topic is a little abstract or complex. Using a picture or diagram is a two part process:
A Content-Encoding like gzip can be used to compress the transmitted data.<ref>https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol</ref>


# [https://www.mediawiki.org/wiki/Help:Managing_files upload a file]
# [https://www.mediawiki.org/wiki/Help:Managing_files upload a file]

Latest revision as of 18:23, 30 May 2018

Exclamation.png This is student work which has not yet been approved as correct by the instructor

Case study notes[1]

Introduction[edit]

Hypertext Transfer Protocol is a communications protocol. It is used to send and receive webpages and files on the internet. It was developed by Tim Berners-Lee and is now coordinated by the W3C. HTTP version 1.1 is the most common used version today. It is defined in RFC 2616.[2]

How it works[edit]

HTTP works by using a user agent to connect to a server. The user agent could be a web browser or spider. The server must be located using a URL or URI. This always contains http:// at the start. It normally connects to port 80 on a computer.

Difference between HTTP and HTTPS[edit]

A more secure version of HTTP is called HTTPS (Hypertext Transfer Protocol Secure). This contains https:// at the beginning of the URL. It encrypts all the information that is sent and received. This can stop malicious users such as hackers from stealing the information and is often used on payment websites. HTTPS uses port 443 for communication instead of port 80[3]

Request message[edit]

The request message contains the following:

  • Request line, such as GET /images/logo.gif HTTP/1.1, which requests the file logo.gif from the /images directory
  • Headers, such as Accept-Language: en
  • An empty line
  • An optional message body

The request line and headers must all end with two characters: a carriage return followed by a line feed, often written <CR><LF>. The empty line must consist of only <CR><LF> and no other whitespace. In the HTTP/1.1 protocol, all headers except Host are optional.

A request line containing only the path name is accepted by servers to maintain compatibility with HTTP clients before the HTTP/1.0 standard.

Example session[edit]

Below is a sample conversation between an HTTP client and an HTTP server running on www.example.com, port 80. As mentioned in the previous sections, all the data is sent in a plain-text (ASCII) encoding, using a two-byte CR LF ('\r\n') line ending at the end of each line.

Client request

 GET /index.html HTTP/1.1
 Host: www.example.com
 

A client request (consisting in this case of the request line and only one header field) is followed by a blank line, so that the request ends with a double newline, each in the form of a carriage return followed by a line feed. The "Host" field distinguishes between various DNS names sharing a single IP address, allowing name-based virtual hosting. While optional in HTTP/1.0, it is mandatory in HTTP/1.1.

Server response

 HTTP/1.1 200 OK
 Date: Mon, 23 May 2005 22:38:34 GMT
 Content-Type: text/html; charset=UTF-8
 Content-Length: 138
 Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
 Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
 ETag: "3f80f-1b6-3e1cb03b"
 Accept-Ranges: bytes
 Connection: close

 <html>
 <head>
   <title>An Example Page</title>
 </head>
 <body>
   Hello World, this is a very simple HTML document.
 </body>
 </html>
 

he ETag (entity tag) header field is used to determine if a cached version of the requested resource is identical to the current version of the resource on the server. Content-Type specifies the Internet media type of the data conveyed by the HTTP message, while Content-Length indicates its length in bytes. The HTTP/1.1 webserver publishes its ability to respond to requests for certain byte ranges of the document by setting the field Accept-Ranges: bytes. This is useful, if the client needs to have only certain portions[34] of a resource sent by the server, which is called byte serving. When Connection: close is sent, it means that the web server will close the TCP connection immediately after the transfer of this response.

Most of the header lines are optional. When Content-Length is missing the length is determined in other ways. Chunked transfer encoding uses a chunk size of 0 to mark the end of the content. Identity encoding without Content-Length reads content until the socket is closed.

A Content-Encoding like gzip can be used to compress the transmitted data.[4]

  1. upload a file
  2. use the file on a wiki page

External links[edit]

  • It would be helpful
  • to include many links
  • to other internet resources
  • to help fellow students
  • Please make sure the content is good
  • and don't link to a google search results, please

References[edit]