mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-22 20:37:58 +08:00
Merge pull request #27971 from takoyaki9n/master
Change the type of URLFetchRequestOptions.payload from string to Object
This commit is contained in:
@@ -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();
|
||||
};
|
||||
@@ -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 <https://github.com/motemen/>
|
||||
// takoyaki9n <https://github.com/takoyaki9n>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="google-apps-script.types.d.ts" />
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user