What is HTTP (2024)

What is HTTP (1)

HTTP stands for Hyper Text Transfer Protocol

WWW is about communication between web clients and servers

Communication between client computers and web servers is done by sending HTTP Requests and receiving HTTP Responses

World Wide Web Communication

The World Wide Web is about communication between web clients and web servers.

Clients are often browsers (Chrome, Edge, Safari), but theycan be any type of program or device.

Servers are most often computers in the cloud.


Web Client


Cloud


Web Server

HTTP Request / Response

Communication between clients and servers is done by requests and responses:

  1. A client (a browser) sends an HTTP request to the web
  2. A web server receives the request
  3. The server runs an application to process the request
  4. The server returns an HTTP response (output) to the browser
  5. The client (the browser) receives the response

The HTTP Request Circle

A typical HTTP request / response circle:

  1. The browser requests an HTML page. The server returns an HTML file.
  2. The browser requests a style sheet. The server returns a CSS file.
  3. The browser requests an JPG image. The server returns a JPG file.
  4. The browser requests JavaScript code. The server returns a JS file
  5. The browser requests data. The server returns data (in XML or JSON).

XHR - XML Http Request

All browsers have a built-in XMLHttpRequest Object (XHR).

XHR is a JavaScript object that is used to transfer data between a web browser and a web server.

XHR is often used to request and receive data for the purpose of modifying a web page.

Despite the XML and Http in the name, XHR is used with other protocols than HTTP,and the data can be of many different types like HTML, CSS,XML, JSON, and plain text.

The XHR Object is a Web Developers Dream, because you can:

  • Update a web page without reloading the page
  • Request data from a server - after the page has loaded
  • Receive data from a server - after the page has loaded
  • Send data to a server - in the background

The XHR Object is the underlying concept of AJAX andJSON:

What is HTTP (2)

W3schools Pathfinder

Track your progress - it's free!

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved.W3Schools is Powered by W3.CSS.

What is HTTP (2024)

FAQs

What is HTTP and why is it used? ›

The Hypertext Transfer Protocol (HTTP) is the foundation of the World Wide Web, and is used to load webpages using hypertext links.

What is the difference between HTTPS and HTTP? ›

HTTPS is HTTP with encryption and verification. The only difference between the two protocols is that HTTPS uses TLS (SSL) to encrypt normal HTTP requests and responses, and to digitally sign those requests and responses. As a result, HTTPS is far more secure than HTTP.

What is a HTTP example? ›

Thus, Hypertext Transfer Protocol is the system of rules which allows data to be transferred using the World Wide Web, where Uniform Resource Locators or URLs (for example, https://www.google.com) can be linked together by hypertext.

What is the difference between HTTP and HTML? ›

HTML (Hyper Text Markup Language) and HTTP (Hypertext Transfer Protocol) are two completely distinct technologies. HTTP is an application protocol that governs how information travels on the World Wide Web, whereas HTML governs how Web pages are formatted and displayed.

Why would anyone use HTTP? ›

HTTP is mostly used to transfer data packets from web servers to web browsers. This allows us to receive and view HTTP documents — also known as web pages. HTTP is the data transfer protocol used by almost every website since the early days of the Internet.

What happens when you use HTTP? ›

HTTP transmits unencrypted data, which means that information sent from a browser can be intercepted and read by third parties. This wasn't an ideal process, so it was extended into HTTPS to add another layer of security to communication. HTTPS combines HTTP requests and responses with SSL and TLS technology.

Why is HTTP not secure? ›

HTTP does not encrypt data during client-to-server communication, which means that any data transmitted over HTTP is sent in plain text without any encryption or security mechanisms. As a result, it can be intercepted and read by anyone with access to the network traffic, including cybercriminals.

Are HTTP websites safe? ›

HTTP does not use encryption, which means that any information you send can be intercepted by someone else on the network. This is why using a secure connection is essential when sending sensitive information.

Can I have both HTTP and HTTPS? ›

Fundamentally, all URLs should only be accessible via one unique address. If URLs are accessible via both HTTP and HTTPS, then you will need to select one of these as the 'canonical' version, and ensure that the other version redirects to the canonical, across all URLs.

What is HTTP for dummies? ›

HTTP is a protocol for fetching resources such as HTML documents. It is the foundation of any data exchange on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser.

What are the basics of HTTP? ›

HTTP is an application-level protocol. The communication usually takes place through TCP/IP sockets, but any reliable transport can also be used. The standard (default) port for HTTP connection is 80, but other port can also be used. The first version of HTTP was HTTP/0.9, which was introduced in 1991.

What are three HTTP methods? ›

The most commonly used HTTP methods are:
  • GET. The GET method is used to retrieve data on a server. ...
  • POST. The POST method is used to create new resources. ...
  • PUT. The PUT method is used to replace an existing resource with an updated version. ...
  • PATCH. The PATCH method is used to update an existing resource. ...
  • DELETE.
Aug 3, 2023

Is HTTP only used for web? ›

Hypertext Transfer Protocol (HTTP) is an application-layer protocol for transmitting hypermedia documents, such as HTML. It was designed for communication between web browsers and web servers, but it can also be used for other purposes.

What is difference between HTTP and URL? ›

A URL is the unique resource, which can be a CSS document or an HTML webpage. HTTP, HTTPS, FTP are the protocols used with the URLs to access the resources. It also indicates the address of a webpage that we type into the space bar.

Is HTTP and the Internet the same? ›

At a high level, we can even think of the Internet as hardware and the Web as software! Web applications use HTTP protocol which is a layer over TCP protocol. Whereas internet applications can use either TCP or UDP protocol.

What is the difference between TCP and HTTP? ›

TCP contains information about what data has or has not been received yet, while HTTP contains specific instructions on how to read and process the data once it's received. TCP manages the data stream, whereas HTTP describes what the data in the stream contains.

Why do we use HTTP in URL? ›

Simply put, HTTP is the protocol that enables communication online, transferring data from one machine to another. WWW is the set of linked hypertext documents that can be viewed on a web browser (such as Google Chrome, Firefox, and more). A major similarity, though, is that both HTTP and WWW are used in website URLs.

Should I use HTTP? ›

Search engines like Google recommend that all websites use HTTPS because it's secure, and sites with SSL certificates are rewarded with a boost in search rankings. Web browsers also alert users if a website isn't safe and uses HTTP.

Top Articles
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 6333

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.