本文整理匯總了TypeScript中@jupyterlab/services.ServerConnection.makeRequest方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ServerConnection.makeRequest方法的具體用法?TypeScript ServerConnection.makeRequest怎麽用?TypeScript ServerConnection.makeRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@jupyterlab/services.ServerConnection
的用法示例。
在下文中一共展示了ServerConnection.makeRequest方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
.then(storedSettings => {
storedSettings.beakerx.githubPersonalAccessToken = githubPersonalAccessToken;
return ServerConnection.makeRequest(
this.settingsUrl,
{
method: 'POST',
body: JSON.stringify({
...storedSettings
})
},
this.serverSettings
).catch(reason => { console.log(reason); })
});
示例2: isNbInGit
function isNbInGit(args: {readonly path: string}): Promise<boolean> {
let request = {
method: 'POST',
body: JSON.stringify(args),
};
let settings = ServerConnection.makeSettings();
return ServerConnection.makeRequest(
URLExt.join(urlRStrip(settings.baseUrl), '/nbdime/api/isgit'),
request, settings).then((response) => {
if (!response.ok) {
return Promise.reject(response);
}
return response.json() as Promise<IApiResponse>;
}).then((data) => {
return data['is_git'];
});
}