Content Service
-
The Content Service allows scripts to serve text in various formats like text, XML, or JSON.
-
The ContentService class is used for returning text content from a script.
-
The MimeType enum defines the various mime types that can be served from a script.
-
The TextOutput object represents the text content that can be served from a script.
This service allows scripts to serve text in various forms, such as text, XML, or JSON. See also the guide to Content Service. If you deploy the following script as a web app, you will see "Hello, world!" in the browser:
function doGet() {
return ContentService.createTextOutput('Hello, world!');
}Classes
| Name | Brief description |
|---|---|
Content | Service for returning text content from a script. |
Mime | An enum for mime types that can be served from a script. |
Text | A TextOutput object that can be served from a script. |
ContentService
MimeType
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 |