Service for returning text content from a script.
You can serve up text in various forms. For example, publish this script as a web app.
function doGet() { return ContentService.createTextOutput("Hello World"); }
Properties
Property | Type | Description |
---|---|---|
MimeType | MimeType |
Methods
Method | Return type | Brief description |
---|---|---|
createTextOutput() | TextOutput | Create a new TextOutput object. |
createTextOutput(content) | TextOutput | Create a new TextOutput object that can serve the given content. |
Detailed documentation
createTextOutput()
Create a new TextOutput
object.
function doGet() { var output = ContentService.createTextOutput(); output.append("Hello world!"); return output; }
Return
TextOutput
— the new TextOutput object.
createTextOutput(content)
Create a new TextOutput
object that can serve the given content.
function doGet() { var output = ContentService.createTextOutput("Hello world!"); return output; }
Parameters
Name | Type | Description |
---|---|---|
content | String | the content to serve. |
Return
TextOutput
— the new TextOutput object.