Lecture 5 Flashcards
What is HTTP?
HTTP (HyperText Transfer Protocol) is an application layer protocol used for transmitting hypermedia documents such as HTML pages over the internet. It is the foundation of data exchange on the Web and operates on a client-server model
What is the basic architecture of HTTP?
HTTP operates on a request/response protocol based on a client/server architecture where clients (e.g., web browsers) send requests to servers, and servers respond with the requested resources
What are the basic features of HTTP communication?
Stateless Protocol: Each request from a client to the server is independent and unrelated to any previous request.
2. Client-Server Architecture: : HTTP operates in a client-server model, where clients (such as web browsers) send requests to servers (such as web servers) for resources, and servers respond with the requested resources.
- Request-Response Protocol: : Communication between the client and server occurs through a request-response cycle
- Text-based
- Methods: HTTP defines several request methods, also known as verbs, that indicate the action to be performed on a resource
- Status Codes
- Uniform Resource Identifiers
What are HTTP methods and give examples?
HTTP methods specify the action to be performed on a resource. Common methods include GET (retrieve a resource), POST (submit data), PUT (update a resource), DELETE (remove a resource), and more
What are HTTP status codes?
HTTP status codes are three-digit codes included in responses to indicate the outcome of a request. Examples include 200 (success), 404 (not found), and 500 (server error)
What is a Uniform Resource Identifier (URI)?
A URI is used to identify resources on the web, consisting of a scheme (e.g., “http://”), a hostname (e.g., “example.com”), and a path (e.g., “/index.html”)
What are java.net.URL and java.net.HttpURLConnection?
java.net.URL represents a Uniform Resource Locator and provides methods for creating and parsing URLs. java.net.HttpURLConnection extends URLConnection and provides functionality specific to HTTP connections, such as setting request methods and headers
What is the HTTP request-response model?
In the HTTP request-response model, a client sends a request (containing a method, headers, and an optional message body) to a server, and the server responds with a status code, headers, and the requested data (if applicable)
What are HTTP messages?
HTTP messages are the units of data exchanged in the HTTP protocol. They include requests (from clients to servers) and responses (from servers to clients), each consisting of a start line, headers, and an optional message body
What are some common uses of HTTP in Java?
Common uses include web scraping, API integration, building web services, data visualization, file upload/download, and real-time communication using protocols like WebSocket
What is data encryption?
Data encryption is the process of converting data from a readable format to a scrambled piece of information to prevent unauthorized access during transmission. It applies to documents, files, messages, or any other form of communication over a network
What are symmetric and asymmetric encryption?
Symmetric encryption uses the same key for encryption and decryption, while asymmetric encryption uses a pair of keys (public and private) where one key encrypts and the other decrypts the data
What is web scraping with Java using JSoup?
Web scraping with Java using JSoup involves fetching data from websites by sending HTTP requests to URLs and parsing the HTML content returned. JSoup is a Java library used for working with HTML and XML files
Why is data encryption important?
Data encryption ensures authentication, privacy, and security. It helps protect against data breaches and unauthorized access during data transmission and storage
What is the AES encryption algorithm?
AES (Advanced Encryption Standard) is a symmetric encryption algorithm widely used for its efficiency and security, supporting key lengths of 128, 192, or 256 bits