本文整理匯總了TypeScript中@types/request-promise-native.RequestPromise.default方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript RequestPromise.default方法的具體用法?TypeScript RequestPromise.default怎麽用?TypeScript RequestPromise.default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@types/request-promise-native.RequestPromise
的用法示例。
在下文中一共展示了RequestPromise.default方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: post
const saveUser = (user: User, database?: string): RequestPromise<any> => post("users", user, database);
示例2: get
const migrate = (database?: string): Promise<any> => get("migrate", {database}).then((response) => {
return response.success ?
Promise.resolve(response) :
Promise.reject(Error("Could not complete migration."));
});
示例3: makeRequest
const post = (path: string, body: any, database?: string): RequestPromise<any> => {
return makeRequest("POST", path, {database}, {body});
};
示例4: del
const deleteUser = (user_id: BackendId, database?: string): RequestPromise<any> => del("users", {user_id, database});