diff --git a/types/google-apps-script/google-apps-script-tests.ts b/types/google-apps-script/google-apps-script-tests.ts index 2c2c74cbc9..a6a3ac8437 100644 --- a/types/google-apps-script/google-apps-script-tests.ts +++ b/types/google-apps-script/google-apps-script-tests.ts @@ -25,3 +25,14 @@ function createAndSendDocument() { // Regression ScriptApp.getService().getUrl(); CalendarApp.GuestStatus.NO; + +// test for URLFetchRequestOptions.payload +import URLFetchRequestOptions = GoogleAppsScript.URL_Fetch.URLFetchRequestOptions; +const postTest = (payload: Object): string => { + const url = 'http://httpbin.org/post'; + const params: URLFetchRequestOptions = { + method: 'post', + payload: payload + }; + return UrlFetchApp.fetch(url, params).getContentText(); +}; \ No newline at end of file diff --git a/types/google-apps-script/google-apps-script.url-fetch.d.ts b/types/google-apps-script/google-apps-script.url-fetch.d.ts index cd43670167..28cc744672 100644 --- a/types/google-apps-script/google-apps-script.url-fetch.d.ts +++ b/types/google-apps-script/google-apps-script.url-fetch.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2018-08-08 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen +// takoyaki9n // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -47,7 +48,7 @@ declare namespace GoogleAppsScript { * payload. It can be a string, a byte array, or a JavaScript object. A JavaScript object will be * interpretted as a map of form field names to values, where the values can be either strings or blobs. */ - payload?: string; + payload?: string | object | Base.Blob; /** * Deprecated. This instructs fetch to resolve the specified URL within the intranet linked to your