# `Alternera.Plugin.MediaType`
[🔗](https://github.com/10e-ab/alternera-sdk/blob/v0.9.0/alternera_plugin_sdk/lib/alternera/plugin/media_type.ex#L1)

What kind of body a `Content-Type` names: JSON (`application/json`,
`text/json`, any `+json` type), XML (`application/xml`, `text/xml`, any
`+xml` type) or neither.

# `base_type`

```elixir
@spec base_type(:json | :xml) :: String.t()
```

The plain media type of a kind, the one a body the proxy writes itself
carries: `application/json`, `application/xml`.

# `essence`

```elixir
@spec essence(String.t() | nil) :: String.t() | nil
```

The media type without its parameters, trimmed and in lower case
(`"Application/JSON; charset=utf-8"` → `"application/json"`); nil for nil.

# `kind`

```elixir
@spec kind(String.t() | nil) :: :json | :xml | nil
```

`:json`, `:xml` or nil for a media type (`essence/1` first).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
