HTTP Entity: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 21: Line 21:
{{External2|Message Body: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3|Entity Body: https://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2}}
{{External2|Message Body: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3|Entity Body: https://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2}}


The '''entity body''' (if any) sent with the HTTP request/response is in a format and encoding defined by the [[Entity HTTP Header Fields|Entity Headers]]. The entity body is obtained from the '''message body''' by applying the inverse of the transfer encoding, as specified by [[HTTP General Header Transfer-Encoding|Transfer-Encoding]], if any.
The '''entity body''' (if any) sent with the HTTP request/response is in a format and encoding defined by the [[Entity HTTP Header Fields|entity headers]]. The entity body is obtained from the '''message body''' by applying the inverse of the transfer encoding, as specified by [[HTTP General Header Transfer-Encoding|Transfer-Encoding]], if any.


==Entity Body Type==
==Entity Body Type==

Latest revision as of 19:45, 26 September 2018

External

Internal

Overview

The HTTP request/response may optionally transfer an entity. An entity consists of entity header fields, which are grouped together with the other headers of the request or response, and an entity-body. The HTTP protocol requires that requests/response which include a body either use chunked transfer encoding or send a Content-Length request header.

Entity Headers

Entity Headers

Entity Body

Message Body: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
Entity Body: https://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2

The entity body (if any) sent with the HTTP request/response is in a format and encoding defined by the entity headers. The entity body is obtained from the message body by applying the inverse of the transfer encoding, as specified by Transfer-Encoding, if any.

Entity Body Type

When an entity body is included with a message, the data type of that body is determined from the entity header fields Content-Type and Content-Encoding. These define a two-layer, ordered encoding model:

entity-body = Content-Encoding(Content-Type(data))

Entity Body Length

The length of a entity is the length of the message body before any transfer encodings have been applied.