Choose the media type and charset
02A media type tells the application what kind of content the bytes represent. A charset tells a text decoder how to map bytes to characters.
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 ↗
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.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
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.
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 ↗