1 / 15

HTTP Fundamentals Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL

HTTP Fundamentals Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL. HTTP:Overview. A protocol which defines how communication should occur between browsers and web servers. Must specify: How a request for a page is packaged.

Download Presentation

HTTP Fundamentals Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HTTP Fundamentals Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL

  2. HTTP:Overview • A protocol which defines how communication should occur between browsers and web servers. • Must specify: • How a request for a page is packaged. • How the response to a request for a page is packaged. • Which types of errors associated with request processing the servers should detect and report.

  3. HTTP Overview • HTTP is basically stateless. This means servers are not required to retain information about a request after the request has been serviced even if the user continues accessing the same server for minutes or hours. • Enhances scalability. Not being required to retain information about a client means that successive requests can be serviced by different machines. • Generally less efficient. • HTTP 1.1 improves efficiency by allowing connections to clients to be kept-alive between requests.

  4. Http

  5. Http

  6. HTTP Request Handling : Static Pages Server Browser Request Lookup Page [Page Found] Packaged Web Page [Page not Found] Packaged Error Mess Render Page

  7. HTTP Request Handling :Servlets Server Browser Request Parse Form Data [Servlet Not Loaded] Load Servlet [Servlet Loaded] Launch Thread to Service Request Produce Web Page Packaged Web Page Render Page

  8. URLs – Uniform Resource Locator • Example: http://www.sheridanc.on.ca/~joe/index.html • Three components PROTOCOL + HOST + FILENAME • Protocol examples: http, ftp, telnet • Name or ip address of host machine. • www.sheridanc.on.ca • 142.76.45.112 • Sometimes host names also include the port number e.g. www.sheridanc.on.ca:8805 • File name: directory and file name of resource

  9. What are Hosts? • A host is a machine or entity on the web that listens for HTTP requests. • Hosts may be able to listen on more than one port for incoming requests. The port acts as a receiving channel. • Ports are identified by numbers e.g. 5705. • Example of URL with a port number. • http://www.myhostingsite.com:6706/a.html

  10. HTTP Request Structure • Request = Request-Line • *(( general-header • request-header • entity-header ) CRLF) • CRLF • [ message-body ] • Request-Line = Method SP Request-URI SP HTTP-Version CRLF • Method = OPTIONS • GET • HEAD • POST • PUT • DELETE • TRACE • CONNECT • extension-method • extension-method = token • Request-URI = * absoluteURI abs_path authority • HTTP-Version = HTTP/1.0 HTTP/1.1

  11. Types of HTTP Status Codes • 1xx Informational Inform browser client of server operation. • 2xx Success • 3xx Redirection • 4xx Client Error Problems with request formatting or invalid URI address coming from browser. • 5xx Server Error. Client Request assumed valid but could not be serviced.

  12. Specific HTTP Status Codes • 201 ; Created • 202 ; Accepted • 203 ; Non-Authoritative Information • 204 ; No Content • 301 ; Moved Permanently • 307 ; Temporary Redirect • 400 ; Bad Request • 401 ; Unauthorized • 402 ; Payment Required • 403 ; Forbidden • 404 ; Not Found • 500 ; Internal Server Error • 501 ; Not Implemented • 502 ; Bad Gateway

  13. HTTP Protocol - Commands • OPTIONS • GET • HEAD • POST • PUT • DELETE • TRACE • CONNECT

  14. HTTP:GET • Get the document specified by the URI • Modifiable with conditions: • If-Match • If-Modified-Since • If-None-Match • If-Unmodified-Since

  15. HTTP:Other Commands • POST • Is sometimes used in place of GET but usually associated with active content or when form data must be transferred. • PUT • Used when a server is requested to store the sent data under the URI name. • DELETE • Used when the server is requested to delete the resource associated with the URI name.

More Related