[id='using_text_based_storage-{context}']
= Storing Data in Text-Based Formats
Configure {brandname} to store data in a text-based format such as `text/
plain`, `application/json`, or `application/xml`.

.Procedure

. Specify a text-based storage format as the MediaType for keys and values.
. Optionally specify a character set such as `UTF-8`.
+
The following example configures {brandname} to store entries with the `text/plain; charset=UTF-8` format:
+
[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/encoding_text_plain.xml[]
----
+
. Configure your clients.

Hot Rod clients can use `org.infinispan.commons.marshall.StringMarshaller`
to handle plain text, JSON, XML, or any other text-based format.

You can also use text-based formats with the ProtoStream marshaller.
ProtoStream can handle `String` and `byte[]` types natively, without the need
to create Serialization Contexts and register Protobuf schemas (`.proto`
files).

REST clients must send the correct headers with requests:

* `Accept: text/plain; charset=UTF-8` for read operations.
* `Content-Type: text/plain; charset=UTF-8` for write operations.
