웹 앱 URL을 방문하면 브라우저에 'Hello World'가 표시됩니다. 보안상의 이유로 스크립트는 브라우저에 콘텐츠를 직접 반환할 수 없습니다. 대신 다른 URL에서 콘텐츠를 게재해야 합니다. 이 때문에 이 웹 앱을 통해 생성된 출력의 브라우저 URL이 원래 스크립트 URL과 다릅니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eContentService allows scripts to return text content, which can be served as a web app.\u003c/p\u003e\n"],["\u003cp\u003eDue to security, content is served from a different URL than the original script URL.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods like \u003ccode\u003ecreateTextOutput()\u003c/code\u003e to generate and manipulate text output objects.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ecreateTextOutput()\u003c/code\u003e can be used with or without initial content, enabling flexible content creation.\u003c/p\u003e\n"]]],[],null,["ContentService\n\nService for returning text content from a script.\n\nYou can serve up text in various forms. For example, publish this script as a web app.\n\n```javascript\nfunction doGet() {\n return ContentService.createTextOutput('Hello World');\n}\n```\nWhen visiting the web app URL you will see \"Hello World\" in the browser. Due to security considerations, scripts cannot directly return content to a browser. Instead, they must serve the content from a different URL. This is why the URL in the browser for output created via this web app will be different than the original script URL. \n\nProperties\n\n| Property | Type | Description |\n|--------------|------------------------------------------------------|-------------|\n| `Mime``Type` | [MimeType](/apps-script/reference/content/mime-type) | |\n\nMethods\n\n| Method | Return type | Brief description |\n|--------------------------------------------------------|----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|\n| [createTextOutput()](#createTextOutput()) | [TextOutput](/apps-script/reference/content/text-output) | Create a new [TextOutput](/apps-script/reference/content/text-output) object. |\n| [createTextOutput(content)](#createTextOutput(String)) | [TextOutput](/apps-script/reference/content/text-output) | Create a new [TextOutput](/apps-script/reference/content/text-output) object that can serve the given content. |\n\nDetailed documentation \n\n`create``Text``Output()` \nCreate a new [TextOutput](/apps-script/reference/content/text-output) object.\n\n```javascript\nfunction doGet() {\n const output = ContentService.createTextOutput();\n output.append('Hello world!');\n return output;\n}\n```\n\nReturn\n\n\n[TextOutput](/apps-script/reference/content/text-output) --- the new TextOutput object.\n\n*** ** * ** ***\n\n`create``Text``Output(content)` \nCreate a new [TextOutput](/apps-script/reference/content/text-output) object that can serve the given content.\n\n```javascript\nfunction doGet() {\n const output = ContentService.createTextOutput('Hello world!');\n return output;\n}\n```\n\nParameters\n\n| Name | Type | Description |\n|-----------|----------|-----------------------|\n| `content` | `String` | the content to serve. |\n\nReturn\n\n\n[TextOutput](/apps-script/reference/content/text-output) --- the new TextOutput object."]]