---
schema_version: "1"
id: 29249a07e17e8dc8716062edbf52c5db99639a367c3f9a5d0c72e15a4d72cedb
title: toString
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-mime-functions-tostring.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-mime-functions-tostring
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6106885fcf8b65b5b04ad236c28c9b9cb4322cbdf4925dceec030c90dd2bafca
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# toString

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## toString(mimeType: MimeType): String

Transforms a `MimeType` value to a string representation.

_Introduced in DataWeave version 2.7.0._

### Parameters

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><p><code>mimeType</code></p></td><td><p><code>MimeType</code></p></td><td><p>The MIME type value to transform to a <code>String</code>.</p></td></tr></tbody></table>

### Example

This example transforms a `MimeType` value without `parameters` to a string representation.

#### Source

```DataWeave
%dw 2.0
import * from dw::module::Mime
output application/json
---
toString({'type': "application", subtype: "json", parameters: {}})
```

#### Output

```Json
"application/json"
```

### Example

This example transforms a `MimeType` value that includes a `parameters` to a string representation.

#### Source

```DataWeave
%dw 2.0
import * from dw::module::Mime
output application/json
---
toString({'type': "multipart", subtype: "form-data", parameters: {boundary: "my-boundary"}})
```

#### Output

```Json
"multipart/form-data;boundary=my-boundary"
```
