Understand URLs
Identify the major parts of a URL and understand what each part represents.
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.
Build a strong understanding of how Web resources are addressed and communicated.
Identify the major parts of a URL and understand what each part represents.
Learn the purpose of HTTP and its request-response model.
Study methods, paths, headers and request bodies.
Learn status codes, response headers and response bodies.
Understand TLS, certificates, confidentiality, integrity and authentication.
Understand the major differences between HTTP/1.1, HTTP/2 and HTTP/3.
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.
A URL tells the client how to access something and where that resource is located.
Let's break a complete URL into its major components.
https identifies the URL scheme used for the resource.
www.codebhavya.com identifies the host.
/Web-Technologies/lesson.html identifies the resource path.
?id=3 supplies query parameters.
#http identifies a location within the document.
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. |
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.
Every HTTP exchange revolves around messages.
The client describes what it wants the server to do or retrieve.
The server reports the result and can return data or a representation of the resource.
Here is a simplified HTTP/1.1-style representation that helps beginners understand the message.
GET indicates the requested operation.
The target identifies the resource being requested.
Headers carry additional metadata about the request.
Some requests contain a body, such as many POST requests.
Methods communicate the intended operation.
Requests a representation of a resource.
RETRIEVESubmits data to a resource and can cause server-side state changes.
SUBMITReplaces the current representation of a target resource with the request content.
REPLACEApplies a partial modification to a resource.
MODIFYRequests deletion of the specified resource.
DELETERequests headers corresponding to a GET response without the response body.
METADATARequests information about communication options available for a target resource.
OPTIONSEstablishes a tunnel to the server identified by the target resource.
TUNNELThese 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.
A response tells the client what happened.
Identifies the HTTP version used for the response representation in this HTTP/1.x-style example.
200 communicates successful completion.
Response headers provide additional metadata and processing instructions.
The response body can contain HTML, JSON, text, media or other content.
The first digit tells you the broad class of response.
Informational responses.
INFORMATIONSuccessful responses.
SUCCESSRedirection responses.
REDIRECTIONClient error responses.
CLIENT ERRORHeaders carry additional information about requests and responses.
Describes the media type of the content.
REPRESENTATIONCommunicates content length when applicable.
SIZECommunicates caching behavior.
CACHECarries credentials or authorization information in supported authentication schemes.
AUTHRequest 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.
HTTP itself does not automatically remember previous requests as application state.
Browser sends a request containing the information needed for that request.
A later request needs its own information needed by the application.
Applications can use mechanisms such as cookies, sessions and authorization tokens to associate multiple requests with application state.
HTTP has evolved while preserving the core HTTP semantics.
HTTPS adds a protected TLS channel around HTTP communication.
HTTP is the Web application-layer protocol. Without TLS protection, the network path does not provide the same cryptographic protections as HTTPS.
HTTPS uses HTTP over a secure TLS-protected connection.
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.
Understand the three important security goals.
Helps prevent network observers from reading protected application data.
PRIVACYHelps detect unauthorized modification of protected data.
PROTECTIONTLS certificate verification helps the client authenticate the server identity.
IDENTITYCertificates help clients verify the identity associated with a secure endpoint.
The certificate contains identity-related information for the server and is digitally signed by a certificate authority.
A trusted certificate authority can issue or sign certificates according to the public-key infrastructure.
The browser validates the certificate chain and relevant identity information according to its trust model.
After the TLS handshake establishes the required cryptographic parameters, protected application data can be exchanged.
Step through a simplified HTTPS connection lifecycle.
The browser begins a secure connection to the target host.
HTTPS uses TLS to establish a protected communication channel.
Certificates help authenticate the server identity.
HTTP application data is exchanged through the protected connection after the security setup succeeds.
Select an HTTP method and inspect the corresponding simplified request and response.
GET /api/students/101 HTTP/1.1 Host: codebhavya.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"studentId": 101
}
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.
See how HTTP concepts combine in an actual application.
A browser or frontend application wants the result of student ID 101.
It may send:
The application server processes the request and returns a response containing structured data.
Avoid these common misunderstandings.
A domain is only one component of many possible parts of a complete URL.
HTTP is a communication protocol; HTML is a markup language.
404 means the requested resource was not found. It does not automatically mean the entire server is down.
HTTPS protects communication with TLS; it does not guarantee that the application's content or behavior is trustworthy.
Think first, then click a card to reveal the answer.
Think about the protocol used for communication between web clients and servers.
HTTP is the Hypertext Transfer Protocol. It defines a client-server request/response communication model used for Web communication.
Think about TLS and protection of communication.
HTTPS is HTTP carried through a TLS-protected channel. TLS provides security properties such as confidentiality, integrity and server authentication.
Compare retrieval with submission and side effects.
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.
Think about how a server communicates the result of a request.
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.
Identify how a web address identifies a resource and access scheme.
A URL is a Uniform Resource Locator. It identifies a resource and includes information such as the scheme and location needed to access it.
Think about the security layer behind HTTPS.
TLS is Transport Layer Security. It establishes a secure communication channel designed to provide properties including authentication, confidentiality and integrity.
Test yourself without looking back at the lesson.
Break the URL https://example.com/products?id=25#reviews into its major components.
Explain the difference between GET, POST, PUT, PATCH and DELETE.
Explain all five HTTP status-code classes.
Explain the difference between an HTTP header and HTTP body.
Explain why HTTPS is more than simply putting an "S" at the end of HTTP.
Explain what happens when a browser receives an HTTP 404 response.
Check your understanding.
Click a term to flip the card and reveal its meaning.
Uniform Resource Locator. A web address that identifies a resource and how to access it.
Hypertext Transfer Protocol, an application-layer protocol used for Web communication.
HTTP carried through a TLS-protected connection.
Transport Layer Security, which provides a protected communication channel.
A method that indicates the intended operation of an HTTP request.
A three-digit code indicating the outcome class of an HTTP request.
Metadata that carries additional information about an HTTP request or response.
A signed digital document used in public-key infrastructure to bind identity information to a public key.
Remember these relationships.
Resource locator
Web communication
Client message
Server message
Request outcome
Message metadata
HTTP over TLS
Secure channel
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.
Finish the lesson and mark this topic as completed.