Web Technologies โ€บ Level 03
LEVEL 03 ยท WEB FUNDAMENTALS

URLs, HTTP and HTTPS

Learn how web addresses identify resources, how browsers and servers exchange HTTP messages, how status codes and headers communicate information, and how HTTPS protects web communication.

๐Ÿ”— URLs ๐ŸŒ HTTP ๐Ÿ” HTTPS ๐Ÿ“š Beginner ๐ŸŽฏ Placement Focus
01

Learning Objectives

Build a strong understanding of how Web resources are addressed and communicated.

๐Ÿ”—

Understand URLs

Identify the major parts of a URL and understand what each part represents.

๐ŸŒ

Understand HTTP

Learn the purpose of HTTP and its request-response model.

๐Ÿ“ค

Understand Requests

Study methods, paths, headers and request bodies.

๐Ÿ“ฅ

Understand Responses

Learn status codes, response headers and response bodies.

๐Ÿ”

Understand HTTPS

Understand TLS, certificates, confidentiality, integrity and authentication.

๐Ÿš€

Compare HTTP Versions

Understand the major differences between HTTP/1.1, HTTP/2 and HTTP/3.

02

What Is a URL?

A URL identifies a resource and provides information about how to locate or access it.

A URL is a Uniform Resource Locator. It is the familiar web address used to access a resource.

A browser can use a URL to identify a web resource such as an HTML page, image, API endpoint, video, document or other network-accessible resource.

๐Ÿ’ก
Simple idea

A URL tells the client how to access something and where that resource is located.

03

Anatomy of a URL

Let's break a complete URL into its major components.

https://www.codebhavya.com/Web-Technologies/lesson.html?id=3#http
01

Scheme

https identifies the URL scheme used for the resource.

02

Host

www.codebhavya.com identifies the host.

03

Path

/Web-Technologies/lesson.html identifies the resource path.

04

Query

?id=3 supplies query parameters.

05

Fragment

#http identifies a location within the document.

04

URL Component Reference

Quickly review the role of each part.

Component Example Purpose
Scheme https Identifies the access scheme.
Host www.example.com Identifies the destination host.
Port :443 Identifies a specific service endpoint when specified.
Path /products/1 Identifies the requested resource path.
Query ?page=2 Carries query parameters.
Fragment #details Identifies a document fragment or location.
05

What Is HTTP?

HTTP is the core application-layer protocol used for Web communication.

HTTP stands for Hypertext Transfer Protocol.

It follows a client-server request/response model. A client such as a browser sends a request and the server sends a response.

HTTP is used for much more than HTML pages. It can carry images, scripts, videos, API data, form submissions and many other kinds of resources.

Remember: HTTP defines the communication semantics; HTML, CSS and JavaScript define the content, presentation and behavior of web pages.
06

HTTP Request and Response

Every HTTP exchange revolves around messages.

CLIENT โ†’ SERVER

HTTP Request

Method
โ†“
Target / Path
โ†“
Headers
โ†“
Optional Body

The client describes what it wants the server to do or retrieve.

SERVER โ†’ CLIENT

HTTP Response

Status Code
โ†“
Headers
โ†“
Optional Body

The server reports the result and can return data or a representation of the resource.

07

Anatomy of an HTTP Request

Here is a simplified HTTP/1.1-style representation that helps beginners understand the message.

GET /Web-Technologies/ HTTP/1.1
Host: codebhavya.com
Accept: text/html
User-Agent: Browser
Connection: keep-alive
01

Method

GET indicates the requested operation.

02

Target

The target identifies the resource being requested.

03

Headers

Headers carry additional metadata about the request.

04

Body

Some requests contain a body, such as many POST requests.

08

HTTP Request Methods

Methods communicate the intended operation.

๐Ÿ“ฅ

GET

Requests a representation of a resource.

RETRIEVE
๐Ÿ“ค

POST

Submits data to a resource and can cause server-side state changes.

SUBMIT
๐Ÿ”„

PUT

Replaces the current representation of a target resource with the request content.

REPLACE
๐Ÿงฉ

PATCH

Applies a partial modification to a resource.

MODIFY
๐Ÿ—‘๏ธ

DELETE

Requests deletion of the specified resource.

DELETE
โ„น๏ธ

HEAD

Requests headers corresponding to a GET response without the response body.

METADATA
โš™๏ธ

OPTIONS

Requests information about communication options available for a target resource.

OPTIONS
๐Ÿ”—

CONNECT

Establishes a tunnel to the server identified by the target resource.

TUNNEL
Placement Tip: Do not memorize HTTP methods without understanding their semantics. Interviewers often ask the difference between GET, POST, PUT, PATCH and DELETE.
09

Safe and Idempotent Methods

These terms describe important properties of HTTP methods.

Method Safe Idempotent Basic Idea
GET Yes Yes Retrieve a representation
HEAD Yes Yes Retrieve headers
PUT No Yes Replace target representation
DELETE No Yes Delete target resource
POST No No Submit/process data
PATCH No Depends on implementation Partial modification

A method is called safe when its defined semantics are read-only from the client's perspective.

An idempotent method means that repeating the same request is intended to have the same effect on the server state as making it once, even though individual responses can differ.

10

Anatomy of an HTTP Response

A response tells the client what happened.

HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1200
Cache-Control: max-age=3600

<html> ... </html>
01

Protocol Version

Identifies the HTTP version used for the response representation in this HTTP/1.x-style example.

02

Status Code

200 communicates successful completion.

03

Headers

Response headers provide additional metadata and processing instructions.

04

Body

The response body can contain HTML, JSON, text, media or other content.

11

HTTP Status Codes

The first digit tells you the broad class of response.

โ„น๏ธ

1xx

Informational responses.

INFORMATION
โœ…

2xx

Successful responses.

SUCCESS
โ†ช๏ธ

3xx

Redirection responses.

REDIRECTION
โš ๏ธ

4xx

Client error responses.

CLIENT ERROR
COMMON RESPONSES

Frequently Seen Codes

200 โ€” successful request
201 โ€” resource created
204 โ€” successful with no response content
301 โ€” permanent redirection
302 โ€” temporary redirection
ERROR RESPONSES

Common Error Codes

400 โ€” bad request
401 โ€” authentication required
403 โ€” forbidden
404 โ€” resource not found
500 โ€” internal server error
503 โ€” service unavailable
12

HTTP Headers

Headers carry additional information about requests and responses.

๐Ÿ“ฆ

Content-Type

Describes the media type of the content.

REPRESENTATION
๐Ÿ“

Content-Length

Communicates content length when applicable.

SIZE
๐Ÿ—ƒ๏ธ

Cache-Control

Communicates caching behavior.

CACHE
๐Ÿ”‘

Authorization

Carries credentials or authorization information in supported authentication schemes.

AUTH

Request and response headers are metadata associated with HTTP messages. They help clients and servers negotiate content, describe representations, control caching, communicate authentication details and more.

Important: A header is metadata. It is not the same thing as the main content carried in the message body.
13

Is HTTP Stateless?

HTTP itself does not automatically remember previous requests as application state.

๐Ÿ“ฉ

Request 1

Browser sends a request containing the information needed for that request.

GET /login
Request metadata
+
๐Ÿ“ฉ

Request 2

A later request needs its own information needed by the application.

GET /dashboard
State mechanisms may be included
๐Ÿ’ก
Then how do login systems work?

Applications can use mechanisms such as cookies, sessions and authorization tokens to associate multiple requests with application state.

14

HTTP/1.1, HTTP/2 and HTTP/3

HTTP has evolved while preserving the core HTTP semantics.

HTTP/1.1

Traditional Message Syntax

โœ” Text-based HTTP message format
โœ” Well-established request/response model
โœ” Connection management features
HTTP/2

More Efficient Transport

โœ” Binary framing
โœ” Multiplexed exchanges
โœ” Header compression
HTTP/3

HTTP over QUIC

โœ” Uses QUIC
โœ” Stream multiplexing
โœ” Designed for lower-latency connection behavior
Important: HTTP/2 and HTTP/3 improve how HTTP communication is transported and framed; the core request/response semantics remain recognizable across versions.
15

HTTP vs HTTPS

HTTPS adds a protected TLS channel around HTTP communication.

๐ŸŒ

HTTP

HTTP is the Web application-layer protocol. Without TLS protection, the network path does not provide the same cryptographic protections as HTTPS.

HTTP communication
No TLS protection by itself
Common scheme: http://
VS
๐Ÿ”

HTTPS

HTTPS uses HTTP over a secure TLS-protected connection.

โœ” Confidentiality
โœ” Integrity
โœ” Server authentication through certificates
Common scheme: https://
16

What Is TLS?

TLS provides the security layer used by HTTPS.

TLS stands for Transport Layer Security.

TLS is designed to provide a secure communication channel between endpoints. Its security goals include authentication, confidentiality and integrity.

01
HTTP Web application-layer communication
โ†“
02
TLS Secure communication channel
โ†“
03
Network Transport Underlying transport depends on HTTP version and deployment
17

What Security Does HTTPS Provide?

Understand the three important security goals.

๐Ÿ”’

Confidentiality

Helps prevent network observers from reading protected application data.

PRIVACY
๐Ÿ›ก๏ธ

Integrity

Helps detect unauthorized modification of protected data.

PROTECTION
โœ…

Authentication

TLS certificate verification helps the client authenticate the server identity.

IDENTITY
Remember: HTTPS does not mean that a website itself is trustworthy. It protects the communication channel; application security is a separate concern.
18

Digital Certificates

Certificates help clients verify the identity associated with a secure endpoint.

01

Website Identity

The certificate contains identity-related information for the server and is digitally signed by a certificate authority.

02

Certificate Authority

A trusted certificate authority can issue or sign certificates according to the public-key infrastructure.

03

Browser Validation

The browser validates the certificate chain and relevant identity information according to its trust model.

04

Secure Session

After the TLS handshake establishes the required cryptographic parameters, protected application data can be exchanged.

19

Premium Visualizer โ€” HTTPS Connection

Step through a simplified HTTPS connection lifecycle.

HTTPS SECURITY TRACE
Step 1 of 8
๐ŸŒ
STEP 01

Browser Requests HTTPS

The browser begins a secure connection to the target host.

https://codebhavya.com

What the visualizer teaches

01

HTTPS uses TLS to establish a protected communication channel.

02

Certificates help authenticate the server identity.

03

HTTP application data is exchanged through the protected connection after the security setup succeeds.

20

Premium Simulator โ€” HTTP Request / Response

Select an HTTP method and inspect the corresponding simplified request and response.

HTTP MESSAGE SIMULATOR
Ready
REQUEST
GET /api/students/101 HTTP/1.1
Host: codebhavya.com
Accept: application/json
RESPONSE
HTTP/1.1 200 OK
Content-Type: application/json

{
  "studentId": 101
}
21

Caching Basics

HTTP also defines mechanisms that allow responses to be reused efficiently.

A cache can store an earlier response and reuse it for a later equivalent request when the response is permitted to be cached.

HTTP caching can reduce response time and network usage. Headers such as Cache-Control and validators such as ETag are important parts of practical caching.

01
Browser May use cached responses
โ†“
02
Intermediate Cache May reuse an eligible response
โ†“
03
Origin Server Generates or returns the representation
22

Real-World Example โ€” Student Result API

See how HTTP concepts combine in an actual application.

Student Result Request

A browser or frontend application wants the result of student ID 101.

It may send:

GET /api/results/101 HTTP/1.1

The application server processes the request and returns a response containing structured data.

๐Ÿ‘จโ€๐ŸŽ“ Student
โ†“
๐ŸŒ Browser
โ†“
๐Ÿ“ค GET /api/results/101
โ†“
โš™๏ธ Application Server
โ†“
๐Ÿ—„๏ธ Database
โ†“
๐Ÿ“ฅ JSON Response
23

Common Beginner Mistakes

Avoid these common misunderstandings.

โŒ

URL = Domain

A domain is only one component of many possible parts of a complete URL.

โŒ

HTTP = HTML

HTTP is a communication protocol; HTML is a markup language.

โŒ

404 Means Server Is Down

404 means the requested resource was not found. It does not automatically mean the entire server is down.

โŒ

HTTPS Means Website Is Safe

HTTPS protects communication with TLS; it does not guarantee that the application's content or behavior is trustworthy.

24

Interview Preparation

Think first, then click a card to reveal the answer.

INTERVIEW QUESTION
01

What is HTTP?

Think about the protocol used for communication between web clients and servers.

Click to reveal answer
ANSWER
โœ“

HTTP

HTTP is the Hypertext Transfer Protocol. It defines a client-server request/response communication model used for Web communication.

Click again to return to the question.
INTERVIEW QUESTION
02

What is the difference between HTTP and HTTPS?

Think about TLS and protection of communication.

Click to reveal answer
ANSWER
โœ“

HTTP vs HTTPS

HTTPS is HTTP carried through a TLS-protected channel. TLS provides security properties such as confidentiality, integrity and server authentication.

Click again to return to the question.
INTERVIEW QUESTION
03

What is the difference between GET and POST?

Compare retrieval with submission and side effects.

Click to reveal answer
ANSWER
โœ“

GET vs POST

GET requests a representation of a resource and is defined as safe. POST submits content for processing and can cause changes or other side effects on the server.

Click again to return to the question.
INTERVIEW QUESTION
04

What are HTTP status codes?

Think about how a server communicates the result of a request.

Click to reveal answer
ANSWER
โœ“

HTTP Status Codes

Status codes indicate the outcome of an HTTP request. They are grouped into five classes: 1xx informational, 2xx successful, 3xx redirection, 4xx client errors and 5xx server errors.

Click again to return to the question.
INTERVIEW QUESTION
05

What is a URL?

Identify how a web address identifies a resource and access scheme.

Click to reveal answer
ANSWER
โœ“

URL

A URL is a Uniform Resource Locator. It identifies a resource and includes information such as the scheme and location needed to access it.

Click again to return to the question.
INTERVIEW QUESTION
06

What is TLS?

Think about the security layer behind HTTPS.

Click to reveal answer
ANSWER
โœ“

TLS

TLS is Transport Layer Security. It establishes a secure communication channel designed to provide properties including authentication, confidentiality and integrity.

Click again to return to the question.
25

Practice Problems

Test yourself without looking back at the lesson.

01

Break the URL https://example.com/products?id=25#reviews into its major components.

02

Explain the difference between GET, POST, PUT, PATCH and DELETE.

03

Explain all five HTTP status-code classes.

04

Explain the difference between an HTTP header and HTTP body.

05

Explain why HTTPS is more than simply putting an "S" at the end of HTTP.

06

Explain what happens when a browser receives an HTTP 404 response.

26

Quick MCQs

Check your understanding.

MCQ 01 EASY

Which part of a URL commonly identifies query parameters?

MCQ 02 EASY

Which HTTP method is defined as requesting a representation of a resource?

MCQ 03 MODERATE

Which status-code class represents client errors?

MCQ 04 MODERATE

What does HTTPS primarily add to HTTP?

27

Glossary

Click a term to flip the card and reveal its meaning.

TERM
URL
Click to see meaning
DEFINITION

URL

Uniform Resource Locator. A web address that identifies a resource and how to access it.

TERM
HTTP
Click to see meaning
DEFINITION

HTTP

Hypertext Transfer Protocol, an application-layer protocol used for Web communication.

TERM
HTTPS
Click to see meaning
DEFINITION

HTTPS

HTTP carried through a TLS-protected connection.

TERM
TLS
Click to see meaning
DEFINITION

TLS

Transport Layer Security, which provides a protected communication channel.

TERM
HTTP Method
Click to see meaning
DEFINITION

HTTP Method

A method that indicates the intended operation of an HTTP request.

TERM
Status Code
Click to see meaning
DEFINITION

Status Code

A three-digit code indicating the outcome class of an HTTP request.

TERM
HTTP Header
Click to see meaning
DEFINITION

HTTP Header

Metadata that carries additional information about an HTTP request or response.

TERM
Digital Certificate
Click to see meaning
DEFINITION

Digital Certificate

A signed digital document used in public-key infrastructure to bind identity information to a public key.

28

Quick Revision

Remember these relationships.

๐Ÿ”— URL

Resource locator

๐ŸŒ HTTP

Web communication

๐Ÿ“ค Request

Client message

๐Ÿ“ฅ Response

Server message

๐Ÿ”ข Status Code

Request outcome

๐Ÿท๏ธ Header

Message metadata

๐Ÿ” HTTPS

HTTP over TLS

๐Ÿ›ก๏ธ TLS

Secure channel

๐ŸŽฏ

Key Takeaway

URLs identify web resources. HTTP defines how clients and servers exchange requests and responses. Methods describe intended operations, headers carry metadata, and status codes communicate the result.

HTTPS combines HTTP with TLS protection so that the communication channel can provide confidentiality, integrity and server authentication.

These concepts will become the foundation for forms, APIs, AJAX, Fetch, authentication, security and server-side technologies later in this course.

โœ“
LEVEL 03

URLs, HTTP and HTTPS

Finish the lesson and mark this topic as completed.