Content

This service allows scripts to serve text in various forms, such as text,
XML, or JSON. See also the [guide to
Content Service](https://developers.google.com/apps-script/content_service). If you
[deploy the following script as a web app](https://developers.google.com/apps-script/execution_web_apps),
you will see "Hello, world!" in the browser:

    function doGet() {
      return ContentService.createTextOutput('Hello, world!');
    }

## Classes

| Name | Brief description |
|---|---|
| `https://developers.google.com/apps-script/reference/content/content-service` | Service for returning text content from a script. |
| `https://developers.google.com/apps-script/reference/content/mime-type` | An enum for mime types that can be served from a script. |
| `https://developers.google.com/apps-script/reference/content/text-output` | A TextOutput object that can be served from a script. |

## `https://developers.google.com/apps-script/reference/content/content-service`

### Properties

| Property | Type | Description |
|---|---|---|
| `MimeType` | `https://developers.google.com/apps-script/reference/content/mime-type` |   |

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/content/content-service#createTextOutput()` | `https://developers.google.com/apps-script/reference/content/text-output` | Create a new `https://developers.google.com/apps-script/reference/content/text-output` object. |
| `https://developers.google.com/apps-script/reference/content/content-service#createTextOutput(String)` | `https://developers.google.com/apps-script/reference/content/text-output` | Create a new `https://developers.google.com/apps-script/reference/content/text-output` object that can serve the given content. |

## `https://developers.google.com/apps-script/reference/content/mime-type`

### Properties

| Property | Type | Description |
|---|---|---|
| `CSV` | `Enum` | CSV Mime Type |
| `ICAL` | `Enum` | ICAL Mime Type |
| `JAVASCRIPT` | `Enum` | JAVASCRIPT Mime Type |
| `JSON` | `Enum` | JSON Mime Type |
| `TEXT` | `Enum` | TEXT Mime Type |
| `VCARD` | `Enum` | VCARD Mime Type |

## `https://developers.google.com/apps-script/reference/content/text-output`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/content/text-output#append(String)` | `https://developers.google.com/apps-script/reference/content/text-output` | Appends new content to the content that will be served. |
| `https://developers.google.com/apps-script/reference/content/text-output#clear()` | `https://developers.google.com/apps-script/reference/content/text-output` | Clears the current content. |
| `https://developers.google.com/apps-script/reference/content/text-output#downloadAsFile(String)` | `https://developers.google.com/apps-script/reference/content/text-output` | Tells browsers to download rather than display this content. |
| `https://developers.google.com/apps-script/reference/content/text-output#getContent()` | `String` | Gets the content that will be served. |
| `https://developers.google.com/apps-script/reference/content/text-output#getFileName()` | `String` | Returns the file name to download this file as, or null if it should be displayed rather than downloaded. |
| `https://developers.google.com/apps-script/reference/content/text-output#getMimeType()` | `https://developers.google.com/apps-script/reference/content/mime-type` | Get the mime type this content will be served with. |
| `https://developers.google.com/apps-script/reference/content/text-output#setContent(String)` | `https://developers.google.com/apps-script/reference/content/text-output` | Sets the content that will be served. |
| `https://developers.google.com/apps-script/reference/content/text-output#setMimeType(MimeType)` | `https://developers.google.com/apps-script/reference/content/text-output` | Sets the mime type for content that will be served. |