cbeatson
cbeatson

Reputation: 31

Outputting other content types; besides HTML with Apps Script

Is there a way to have a stand alone app output any other content-type besides HTML. i.e. if I wanted to output plain text so it could be consumed by another app (creating a simple web service)?

Upvotes: 2

Views: 683

Answers (1)

Eric Koleda
Eric Koleda

Reputation: 12673

This week we launched the ContentService, which allows you to return content in formats such as JSON, ATOM, and plain text.

function doGet(e) {
  return ContentService.createTextOutput('Hello World')
      .setMimeType(ContentService.MimeType.TEXT);
}

Upvotes: 4

Related Questions