DEV Community

Discussion on: Where to Put Response Metadata - Envelope or HTTP Headers?

Collapse
 
ecarrara profile image
Erle Carrara

Yes, body is a raw data that you can serialize to represent values with types (usually according to Content-Type header).

See RFC 723. tools.ietf.org/html/rfc7230#sectio...

Historically, HTTP has allowed field content with text in the ISO-8859-1 charset [ISO-8859-1], supporting other charsets only through use of [RFC2047] encoding. In practice, most HTTP header field values use only a subset of the US-ASCII charset [USASCII]. Newly defined header fields SHOULD limit their field values to US-ASCII octets. A recipient SHOULD treat other octets in field content (obs-text) as opaque data.

The body of http message can be anything you like... But headers not.