HTTP - Hypertext Transfer Protocol =================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is HTTP?** HTTP stands for Hypertext Transfer Protocol. It is the foundation of data communication on the web, allowing browsers and servers to send and receive web content like HTML pages, images, videos, and more. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why is HTTP useful?** * Enables browsing websites and accessing online content. * Supports client-server communication over the internet. * Is stateless and lightweight, making it fast and scalable. * Forms the basis for REST APIs and modern web applications. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How it works?** * **Client sends a request:** Your browser sends an HTTP request to a web server (e.g., `GET /index.html`). * **Server processes the request:** The server locates and prepares the requested resource. * **Server sends a response:** The server returns the content (like a webpage) along with a status code (e.g., `200 OK`). * **Browser displays the content:** The user sees the requested webpage or data. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Where is HTTP used?** * **Web browsing:** Loading websites and web applications. * **APIs:** Communication between frontend clients and backend services. * **Mobile apps:** To fetch and send data to cloud-based services. * **IoT devices:** For lightweight communication with web APIs and platforms. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why OSI Layer: Application Layer (Layer 7)?** * HTTP defines how web content is requested, served, and interpreted. * It provides services directly to end users and applications. * It operates above transport protocols like TCP (Layer 4) and handles high-level logic like headers, methods, and cookies. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`HTTP Version&RFC Details ` * :ref:`HTTP Basic Setup on Ubuntu using IPv4 ` * :ref:`Use case curl with HTTP ` * :ref:`Use case wget with HTTP ` * :ref:`HTTP Basic Setup on Ubuntu using IPv6 ` * :ref:`HTTP Protocol Packet Details ` * :ref:`HTTP Usecases ` * :ref:`HTTP Basic Features ` * :ref:`HTTP Feature : Stateless protocol ` * :ref:`HTTP Feature : Client Server Architecture ` * :ref:`HTTP Feature : Media Type support ` * :ref:`HTTP Feature : Flexible methods ` * :ref:`HTTP Feature : Resource Identification ` * :ref:`HTTP Feature : Extensible Headers ` * :ref:`HTTP Feature : Caching support ` * :ref:`HTTP Feature : Secure Communication ` * :ref:`HTTP Feature : Persistent Connections ` * :ref:`HTTP Feature : Proxy and Gateway support ` * :ref:`Reference links ` .. _HTTP_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _HTTP_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _HTTP_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. tab-set:: .. tab-item:: HTTP Version&RFC Details .. csv-table:: :file: ./HTTP/HTTP_rfcdetails.csv :widths: 10,10,10,30 :header-rows: 1 .. _HTTP_step19: .. tab-set:: .. tab-item:: HTTP Basic Setup on Ubuntu using IPv4 * setup .. _HTTP_step26: .. tab-set:: .. tab-item:: Use case curl with HTTP .. code-block:: shell test:~$ curl http://c-pointers.com * Expected output:The HTML source code of the webpage hosted at http://c-pointers.com * Step-1 : wireshark captures * client side :download:`Download capture ` * Step-2 : screenshots * client side .. image:: HTTP/wireshark_screenshots/curl_http_client.png :width: 2000 .. _HTTP_step27: .. tab-set:: .. tab-item:: Use case wget with HTTP .. code-block:: shell test:~$ wget http://c-pointers.com * Expected output:The HTML content of the webpage at http://c-pointers.com * Step-1 : wireshark captures * client side :download:`Download capture ` * Step-2 : screenshots * client side .. image:: HTTP/wireshark_screenshots/wget_http_client.png :width: 2000 .. _HTTP_step20: .. tab-set:: .. tab-item:: HTTP Basic Setup on Ubuntu using IPv6 * setup .. _HTTP_step6: .. tab-set:: .. tab-item:: HTTP Protocol Packet Details **HTTP Request Packet** .. csv-table:: :file: ./HTTP/HTTP_packetdetails1.csv :widths: 10,20,30,10 :header-rows: 1 **Response Packet** .. csv-table:: :file: ./HTTP/HTTP_packetdetails2.csv :widths: 10,20,30,10 :header-rows: 1 .. _HTTP_step7: .. tab-set:: .. tab-item:: HTTP Usecases .. csv-table:: :file: ./HTTP/HTTP_usecases.csv :widths: 10,20,30 :header-rows: 1 .. _HTTP_step8: .. tab-set:: .. tab-item:: HTTP Basic Features .. csv-table:: :file: ./HTTP/HTTP_basicfeatures.csv :widths: 10,10,30 :header-rows: 1 .. _HTTP_step9: .. tab-set:: .. tab-item:: HTTP Feature : Stateless protocol **Stateless protocol - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature1_Stateless_protocol.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step10: .. tab-set:: .. tab-item:: HTTP Feature : Client server Architecture **Client server Architecture - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature2_Client_server_Architecture.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step11: .. tab-set:: .. tab-item:: HTTP Feature : Media Type support **Media Type support - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature3_Media_Type_support.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step12: .. tab-set:: .. tab-item:: HTTP Feature : Flexible methods **Flexible methods - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature4_Flexible_methods.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step13: .. tab-set:: .. tab-item:: HTTP Feature : Resource Identification **Resource Identification - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature5_Resource_Identification.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step14: .. tab-set:: .. tab-item:: HTTP Feature : Extensible Headers **Extensible Headers - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature6_Extensible_Headers.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step15: .. tab-set:: .. tab-item:: HTTP Feature : Caching support **Caching support - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature7_Caching_support.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step16: .. tab-set:: .. tab-item:: HTTP Feature : Secure Communication **Secure Communication - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature8_Secure_Communication.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step17: .. tab-set:: .. tab-item:: HTTP Feature : Persistent Connections **Persistent Connections - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature9_Persistent_Connections.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step21: .. tab-set:: .. tab-item:: HTTP Feature : Proxy and Gateway support **Proxy and Gateway support - Testcases** .. csv-table:: :file: ./HTTP/HTTP_feature10_Proxy_and_Gateway_support.csv :widths: 10,10,30,20 :header-rows: 1 .. _HTTP_step18: .. tab-set:: .. tab-item:: Reference links * Reference links