CMPE-011 Web and HTTP Lecture Notes PDF
Document Details
Uploaded by WellKnownIridium8922
University of the Philippines
Tags
Summary
This document is a lecture on web and HTTP covering fundamental topics of web technologies. The lecture notes include sections on Web, Client-Server Model, Components of the Web, HTTP, and more. It is part of a course on Computer Fundamentals and Programming.
Full Transcript
Computer Fundamentals and Programming Lecture Web and HTTP Objectives: At the end of this lesson, students will be able to : Understand the Fundamentals of the Web Identify HTTP Methods and Their Uses Explore Web Technologies The Web and HTTP Web World Wide Web (WWW) is a...
Computer Fundamentals and Programming Lecture Web and HTTP Objectives: At the end of this lesson, students will be able to : Understand the Fundamentals of the Web Identify HTTP Methods and Their Uses Explore Web Technologies The Web and HTTP Web World Wide Web (WWW) is a vast network of interconnected documents and resources, linked by hyperlinks and URLs. It allows users to access information and services over the Internet through web browsers. It plays a critical role in data management, communication, and automation. Client-Server Model The web operates on a client-server model, where the client (typically a web browser) requests resources from a server, which then responds with the requested data. Client: The end-user device (e.g., desktop, smartphone) running a web browser. Sends requests for web resources via HTTP/HTTPS. Server: A powerful machine that hosts websites and serves resources to clients. Can handle multiple requests simultaneously through various technologies (e.g., Apache, IIS). What are the components of the Web Components of the Web Web Browsers Web Servers Web Pages URLs Components of the Web Web Browsers: Software applications like Chrome, Firefox, and Safari that allow users to access and navigate the web. Web Servers: Computers that store, process, and serve web pages to clients (browsers) upon request. Example Apache web server, Internet Information Services (IIS). Web Pages: Documents formatted in HTML (HyperText Markup Language) that can include text, images, videos, and links. URLs (Uniform Resource Locators): Addresses used to locate resources on the web. A URL specifies the protocol (HTTP or HTTPS), the domain name, and the path to the resource. What is HTTP? HTTP (HyperText Transfer Protocol) is the foundational protocol used for transmitting data over the web. It defines how messages are formatted and transmitted, and how web servers and browsers should respond to various commands. Key Features of HTTP: 1. Stateless Protocol: Each request from a client to a server is treated as an independent transaction. The server does not retain any information about previous requests. 2. Request-Response Model: Communication involves a client sending a request to a server, which then responds with the requested resource or an error message. 3. Methods: HTTP defines several methods (also known as verbs) for different types of actions: GET: Requests data from a specified resource. POST: Submits data to be processed to a specified resource. PUT: Updates a specified resource with new data. DELETE: Removes a specified resource. 4. Status Codes: Each response from the server includes a status code that indicates the result of the request. Common status codes include: 200 OK: The request was successful. 404 Not Found: The requested resource could not be found. 500 Internal Server Error: The server encountered an unexpected condition. How to see the status codes Google Chrome Open Chrome and navigate to the website you want to inspect. Right-click anywhere on the page and select Inspect or press Ctrl + Shift + I (Windows/Linux) or Cmd + Option + I (Mac). Go to the Network tab. Refresh the page (press F5 or click the refresh icon). You will see a list of all network requests made by the page. Look for the status codes in the Status column. 1xx: Informational 100 Continue: The initial part of a request has been received, and the client can continue. 101 Switching Protocols: The server is switching protocols as requested by the client. 2xx: Success 200 OK: The request was successful. 201 Created: The request has been fulfilled and a new resource has been created. 204 No Content: The request was successful, but there is no content to send back. 3xx: Redirection 301 Moved Permanently: The requested resource has been moved to a new URL permanently. 302 Found: The requested resource is temporarily located at a different URL. 304 Not Modified: The resource has not been modified since the last request. 4xx: Client Errors 400 Bad Request: The request could not be understood or was missing required parameters. 401 Unauthorized: Authentication is required and has failed or has not yet been provided. 404 Not Found: The requested resource could not be found. 5xx: Server Errors 500 Internal Server Error: A generic error message indicating that the server encountered an unexpected condition. 502 Bad Gateway: The server was acting as a gateway and received an invalid response from the upstream server. 503 Service Unavailable: The server cannot handle the request due to temporary overload or maintenance. 5. Headers: HTTP headers provide essential information about the request or response, such as content type, length, and encoding. The Role of HTTPS HTTPS (HyperText Transfer Protocol Secure) is an extension of HTTP that includes security features. It uses SSL/TLS (Secure Sockets Layer/Transport Layer Security) to encrypt data transmitted between the client and server, ensuring confidentiality and integrity. This is particularly important for transactions that involve sensitive information, such as personal data and financial details. Web Technologies HTML (HyperText Markup Language): The standard markup language for creating web pages. HTML structures content on the web. CSS (Cascading Style Sheets): A style sheet language used to describe the presentation of a document written in HTML. CSS controls layout, colors, fonts, and overall appearance. JavaScript: A programming language used to create dynamic and interactive web content. It allows for real-time updates and user interaction without needing to reload the page. Cookies Small pieces of data sent from a server to a client, typically used to store user preferences and session information. Sessions A way to maintain a state of the user across multiple requests, often facilitated by cookies or other mechanisms. type of cookie that expires when the browser is closed. The Importance of the Web in Industrial Engineering Data Access: Engineers can access vast amounts of data and resources online, facilitating research and development. Collaboration: Tools and platforms enable real-time collaboration among teams across different locations. Automation: Many industrial processes can be monitored and controlled through web interfaces, improving efficiency and reducing downtime. E-commerce: Understanding web technologies is critical for businesses involved in online sales, supply chain management, and customer relationship management. Thank you. End of lesson.