Visual RFC.
ALL RFCs / RFC 2397
Read the RFC ↗
RFC 2397 / INLINE DATA URLS

Choose the media type and charset

02

A media type tells the application what kind of content the bytes represent. A charset tells a text decoder how to map bytes to characters.

RFC 2397 · § 2EXAMPLE
3 / 3
Choose the media type and charsetThree independent metadata examples. Omitted metadata defaults to text/plain with US-ASCII charset. Charset UTF-8 alone uses the text/plain shorthand. Explicit application/octet-stream with percent00 percentFF yields binary bytes00 FF, not default ASCII text. Media type and charset describe intended interpretation; neither proves safety or valid media content. Examples avoid unresolved quoted-parameter ambiguity.Explicit type: binary contentdata:application/octet-stream,%00%FFread the declared interpretationapplication/octet-streambytes: 00 FFNo automatic ASCII text conversion
03
Keep explicitly binary data binary.

data:application/octet-stream,%00%FF declares generic binary content. The bytes 00 FF are not automatically decoded as default ASCII text.

Source for this drawing: RFC 2397 · Read RFC section 2 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A request starts a conversation.

A client asks for a resource. A server sends a response. The method, address, headers, and status explain what that conversation means.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Omitted metadata has a defined text default.

  • Omitting the media type defaults to text/plain;charset=US-ASCII. The comma is still required, including for empty data.
  • The shorthand may omit text/plain while supplying a charset parameter, as in data:;charset=UTF-8,Hi. A parameter has an attribute, an equals sign and a value.
  • An explicit type/subtype overrides the omitted-type default. A declared type is a description, not proof that its bytes are valid or safe for that type.
DETAILS

US-ASCII and UTF-8 are character encodings. Hi uses the same bytes in both; no non-ASCII decoding is implied by this example. The explicit application/octet-stream example carries binary bytes, not automatically readable text. Complex quoted parameter values have unresolved errata; this guide uses simple tokens and does not resolve that ambiguity.

Read the RFC section ↗

All chapters in RFC 2397

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗