💻
JWC13 Learning Resources
  • Home Page
  • 💻Programming Major
    • Learning Agenda
    • Learning Scope
    • 🥼Self-learning Project
    • Website Development Fundamental
      • Semantic HTML 💎
      • CSS 💎
        • CSS Fundamental
        • Flexbox
        • Grid
        • Responsive
        • CSS Frameworks
          • Bootstrap
          • TailwindCSS
      • Javascript 💎
        • Script tag
        • Events
        • DOM
        • JQuery ⭐️
        • Hoisting & Scoping
        • Callbacks
        • Arrays
        • Objects
        • Promise
        • Async
        • Error Handling
    • Intermediate Website Development
      • HTTP Protocol
      • Client Server Architecture
        • Web Server
        • REST API
        • Server-Side Rendering
          • PHP
          • Express & EJS
      • Firebase⭐️
      • Version Control💎
      • Hosting Website
        • Firebase Hosting
        • Netlify
        • Vercel
    • Fullstack Development for Software Engineers
      • Typescript
      • Node.js
      • Rendering Patterns
      • Frameworks & UI Libraries
        • React
        • Next.js
        • SvelteKit
        • Laravel
      • Build Tools
      • Backend Development
        • API Architecture
        • CRUD
        • Cookies & Authentication
        • Containerize
        • Database
          • Object Relational Mapping
          • MongoDB
      • Object Oriented Programming
      • Design Patterns
    • Hands-On Project
      • Next.js Fullstack
      • SvelteKit Fullstack
      • Laravel Fullstack
  • 🎨Design Major
    • 🍄Pre-camp Activity Summary
    • 👀Intro to Figma 101 class
Powered by GitBook
On this page

Was this helpful?

  1. Programming Major
  2. Intermediate Website Development

HTTP Protocol

Generated by ChatGPT. Double check the correctness.

The HTTP (HyperText Transfer Protocol) protocol is a foundational technology for the web, enabling communication between web browsers and servers. Here are the key aspects of HTTP:

Basics

  1. Protocol: HTTP is a protocol, which is a set of rules for communication. It defines how messages are formatted and transmitted, and how web servers and browsers should respond to various commands.

  2. Client-Server Model: HTTP operates based on a client-server model. The client, usually a web browser, sends a request to the server, which then processes the request and sends back a response.

Components

  1. URL (Uniform Resource Locator): The address used to access resources on the web. For example, http://www.example.com.

  2. Request Methods: Methods indicating the desired action to be performed for a given resource. Common methods include:

    • GET: Requests data from a specified resource.

    • POST: Submits data to be processed to a specified resource.

    • PUT: Updates a current resource with new data.

    • DELETE: Removes a specified resource.

    • HEAD: Similar to GET, but retrieves only the headers and not the body of the response.

  3. Headers: Key-value pairs sent in both requests and responses, providing metadata such as content type, length, encoding, and more.

  4. Body: The main content of the request or response, used to transmit data like HTML, JSON, or files.

Process

  1. Request: The client (browser) sends an HTTP request to the server, which includes:

    • The HTTP method.

    • The URL of the resource.

    • HTTP headers.

    • (Optional) A message body.

  2. Response: The server processes the request and sends back an HTTP response, which includes:

    • A status line (e.g., HTTP/1.1 200 OK).

    • HTTP headers.

    • (Optional) A message body with the requested content or error information.

Status Codes

HTTP status codes indicate the result of the request. They are grouped into categories:

  1. 1xx: Informational responses (e.g., 100 Continue).

  2. 2xx: Success (e.g., 200 OK, 201 Created).

  3. 3xx: Redirection (e.g., 301 Moved Permanently, 302 Found).

  4. 4xx: Client errors (e.g., 404 Not Found, 403 Forbidden).

  5. 5xx: Server errors (e.g., 500 Internal Server Error, 503 Service Unavailable).

Versions

  1. HTTP/1.0: The original version, simple but with limitations like lack of persistent connections.

  2. HTTP/1.1: Introduced persistent connections, chunked transfer encoding, and additional cache control mechanisms.

  3. HTTP/2: Improved performance with features like multiplexing, header compression, and server push.

  4. HTTP/3: Builds on HTTP/2 and uses QUIC, a transport protocol that improves latency and connection reliability.

HTTP is a stateless protocol, meaning each request from a client to server is independent, and neither the client nor the server retains session information between requests. This characteristic can be managed through mechanisms like cookies, sessions, and tokens to maintain stateful interactions.

PreviousIntermediate Website DevelopmentNextClient Server Architecture

Last updated 11 months ago

Was this helpful?

💻
Network Protocols
HTTP Protocols
REST API with Javascript