HTMLs Tutorial

HTML Tutorial HTML Tags HTML Basic Tags HTML Attributes HTML Elements HTML Formatting HTML Text Format HTML body tag HTML samp tag HTML script Tag HTML section tag HTML select tag HTML source tag HTML span tag HTML strike tag HTML strong tag HTML style tag HTML sub tag HTML summary tag HTML sup Tag HTML svg tag HTML table tag HTML u tag HTML Headings HTML Paragraphs HTML wbr tag HTML Anchor HTML Image HTML Lists HTML Ordered List HTML Unordered List HTML Form HTML Form input HTML with CSS HTML Layouts HTML References HTML Frames HTML Links Fieldset Tag in HTML Basic HTML Tags Br Tag in HTML Free HTML Templates How to Create a Table in HTML HTML Calendar HTML Card HTML Cellspacing HTML Center Image HTML Checkbox Read-only HTML Cleaner HTML Code for a Tab HTML Comment HTML Compiler HTML Nested Forms HTML Overlay Text on the Image HTML Select Option Default HTML Snake Game HTML Subheader HTML Tab Character dd Tag in HTML How Many HTML Tags are There HTML Align Tag HTML Responsive HTML Tab Code HTML Table Alternate Row Color HTML Table Fix Column Width Contact HTML DL Tag in HTML How to Insert Image in HTML HTML Background Color HTML Dark Mode How to Convert HTML to PNG HTML Data Toggle HTML Email Template HTML Font Color HTML Font Family ID and Class in HTML HTML Tab Space HTML Tab Tag HTML Itemprop HTML Itemscope HTML Form Design HTML Input Only Numbers HTML Textarea HTML to JPG HTML to Markdown Python li Tag in HTML MDN HTML What is the Correct HTML for Making a Hyperlink? What is the Root Element of an HTML Document How to Make a Box in HTML How to Save HTML Files in Notepad How to Align Text in HTML How to Change Font Color in HTML? How to Change Font Size in HTML How to Change Image Size in HTML How to Create a HTML Page How to Create a Link in HTML File? How to Create an HTML File? HR Tag in HTML HTML Base Tag HTML Default Attribute HTML Hyperlink HTML Indent HTML Injection Payloads HTML Input Numbers Only HTML Roadmap HTML Row Height HTML Schedule HTML Space HTML Tab HTML vs HTTP HTML5 API HTML5 Video HTML Collection to Array Text Area in HTML

HTML5 Advance

HTML5 Tutorial HTML5 Tags HTML Button Tag HTML canvas Tag HTML caption Tag HTML City tag HTML Tag HTML5 SVG HTML Event Attribute HTML5 Audio HTML5 Youtube HTML5 Button Tag HTML5 Tags

Misc

How to add JavaScript to HTML How to change font in HTML How to change text color in HTML HTML Date HTML Hide Element HTML Nested Table HTML Reset Button What does HTML stand for? HTML Background Image HTML Tag Div Tag in HTML How to insert Image in HTML How to create a link with no underline in HTML How to insert spacestabs in text using HTMLCSS HTML tag HTML Code HTML Tag HTML Canvas Design a tribute page using HTML and CSS What is a Container tag Font tag in HTML Difference between HTML and DHTML Empty Tag in HTML HTML Button Link Html Line Break Img src HTML Nested List in HTML Placeholder in HTML TD in HTML HTML Space Code HTML Target Attribute HTML Tag Markup Meaning in HTML Border-Collapse in HTML HTML Onclick Online HTML Compiler Convert HTML to PDF HTML Formatter HTML5 - Web Storage HTTP – Responses Container Tag in HTML DL Tag in HTML Horizontal Rule HTML HTML Tab Text Html Table Cell Background Color HTML Table Cell Color HTML Col Width How Many HTML Tags are There Convert String to Unicode Characters in Python HTML Runner HTML Style Attribute HTML Superscript Attribute HTML tabindex Marquee Tag in HTML HTML Dynamic Form HTML side Tag HTML Pattern Attribute HTML q Tag HTML Readonly Base 64 Encoding in HTML Documents Enhancing Data Portability and Security Evo Cam Web Cam HTML Free code camp HTML CSS How to Add a JS File in HTML? How to Add Picture in HTML How to Add the Logo in HTML? How to Add Video in HTML HTML Class Attribute HTML Entities HTML Form Elements HTML Form Templates HTML Marquee Tag HTML Radio Buttons HTML Text box HTML to JSX HTML Tooltip Basic HTML Codes How to Align Image Center in HTML HTML Header Tag HTML Image Tag HTML Next Line

HTTP – Responses

Introduction:

Hypertext Transfer Protocol, which Tim Berner invented, is referred to as HTTP. Hypertext is a specific kind of text specially programmed using Hyper Text Markup Language (HTML), a standard programming language. The most recent version of HTTP, released in 2022, is HTTP/3.

Hypertext Transfer Protocol is the name of the protocol that allows hypertext to be transferred between two computers.

A web browser and server can communicate using the HTTP standard. It is a collection of guidelines for transferring data between computers. On the World Wide Web, information is shared through text, photos, and other multimedia files. Users indirectly use HTTP each time they open their web browser. It is an application protocol for hypermedia information systems that are distributed and collaborative.

HTTP Response

A server sends HTTP responses to the client. The resource that is requested by the client is given to them using the response. It's also utilized to let the customer know that the requested action has been completed. It can also let the client know that there was a problem with the way their request was handled.

The contents of an HTTP response include the following:

  1. Status Line
  2. A collection of HTTP headers or Status Line Response Header Fields
  3. Message Body

Every HTTP header in the request message is followed by a carriage return line feed (CRLF). The message body starts after the final HTTP header and is followed by another CRLF.

Status Line:

The status line appears first in the response message. There are three things on the status line:

a) The version number of HTTP:

It helps to display the HTTP specification with which the server attempted to complies when sending the message.

Example:

HTTP-Version = HTTP/1.1  

b) Status Code:

The result of the request is indicated by this three-digit number. The response's class is specified by the first digit. There is no categorization function for the final two numbers. The first digit has five values, which are as follows:

Status Code and Description:

HTTP – Responses

1xx: Information:

It confirms the receiving of the request and the continuation of the procedure.

2xx: Success:

It demonstrates that the action was successfully received, understood, and approved.

3xx: Redirection:

It indicates that more work has to be done in order to fulfill the request.

4xx: Error from the Client

It indicates that either the request cannot be carried out or its syntax is incorrect.

5xx: Error on the server

It indicates that a valid request was not fulfilled by the server.

c) Reason Phrase

Another name for it is the status text. The text that describes the significance of the status code is understandable by humans.

The following is an example of a response line:

HTTP/1.1 200 OK  

In this case,

  • HTTP version is HTTP/1.1.
  • The status code is 200.
  • The reason is "OK"

Response Header Fields:

The information a client can use to learn more about the response and the server delivered that is contained in the HTTP Headers of the server's response. With the usage of this data, the client can help display the response to the user, store the result for later use, and send more requests to the server now or in the future.

response-header = Accept-Ranges                              | Age                                       | ETag                                       | Location                                  | Proxy-Authenticate                         | Retry-After                                | Server                               | Vary                                      | WWW-Authenticate        

Only when the protocol version is modified, then the name of the Response-header field can be extended

Message Body:

For convenience, the message body of the responses may be referred to as the response body.

The majority of responses are made in the message body. There are two exceptions: one is when a server responds to a client request that requests the headers but not the body of the response, and the other is when a server uses specific status codes.

When a request is successful, the body of the message includes either the resource which is requested by the client or some information regarding the status of the action the client requested. For the body of the message in response of an unsuccessful request may provide more details regarding a step the client needs to do to properly finish the request or the reason of the issue.

Conclusion

HTTP is a user-friendly, extensible protocol. The addition of headers and the client-server architecture enable HTTP to grow along with the expanded features of the Web. The fundamental structure of messages has not changed since HTTP/1.0, despite HTTP/2 adding considerable complexity by embedding HTTP messages in frames to increase performance. Because the session flow is still straightforward, an HTTP message monitor can be used to examine and troubleshoot it.