當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ajax.ajax函數代碼示例

本文整理匯總了TypeScript中rxjs/ajax.ajax函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript ajax函數的具體用法?TypeScript ajax怎麽用?TypeScript ajax使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ajax函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: ajax

export const listCheckpoints = (serverConfig: ServerConfig, path: string) =>
  ajax(
    createAJAXSettings(serverConfig, formCheckpointURI(path, ""), {
      cache: false,
      method: "GET"
    })
  );
開發者ID:nteract,項目名稱:nteract,代碼行數:7,代碼來源:contents.ts

示例2: publishGist

function publishGist(
  model: { files: GithubFiles; description: string; public: boolean },
  token: string,
  id: string | null
) {
  const url =
    id !== null
      ? `https://api.github.com/gists/${id}`
      : "https://api.github.com/gists";

  const opts = {
    url,
    responseType: "json",
    // This allows for us to provide a serverside XMLHttpRequest
    createXHR() {
      return new XMLHttpRequest();
    },
    headers: {
      "Content-Type": "application/json",
      // We can only update authenticated gists so we _must_ send the token
      Authorization: `token ${token}`
    },
    method: id !== null ? "PATCH" : "POST",
    body: model
  };

  return ajax(opts);
}
開發者ID:nteract,項目名稱:nteract,代碼行數:28,代碼來源:github-publish.ts

示例3: ajax

export const get = (
  serverConfig: ServerConfig,
  sessionID: string
): Observable<AjaxResponse> =>
  ajax(
    createAJAXSettings(serverConfig, `/api/sessions/${sessionID}`, {
      cache: false
    })
  );
開發者ID:nteract,項目名稱:nteract,代碼行數:9,代碼來源:sessions.ts

示例4: ajax

export const get = (
  serverConfig: ServerConfig,
  name: string
): Observable<AjaxResponse> =>
  ajax(
    createAJAXSettings(serverConfig, `/api/kernelspecs/${name}`, {
      cache: false
    })
  );
開發者ID:nteract,項目名稱:nteract,代碼行數:9,代碼來源:kernelspecs.ts

示例5: ajax

export const destroy = (
  serverConfig: ServerConfig,
  id: string
): Observable<AjaxResponse> =>
  ajax(
    createAJAXSettings(serverConfig, formURI(id), {
      method: "DELETE"
    })
  );
開發者ID:nteract,項目名稱:nteract,代碼行數:9,代碼來源:terminals.ts

示例6: ajax

export const restoreFromCheckpoint = (
  serverConfig: ServerConfig,
  path: string,
  checkpointID: string
) =>
  ajax(
    createAJAXSettings(serverConfig, formCheckpointURI(path, checkpointID), {
      method: "POST"
    })
  );
開發者ID:kelleyblackmore,項目名稱:nteract,代碼行數:10,代碼來源:contents.ts

示例7: ajax

export const create = (serverConfig: ServerConfig, body: object): Observable<AjaxResponse> =>
  ajax(
    createAJAXSettings(serverConfig, "/api/sessions", {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body
    })
  );
開發者ID:kelleyblackmore,項目名稱:nteract,代碼行數:10,代碼來源:sessions.ts

示例8: ajax

export const start = (serverConfig: ServerConfig, name: string, path: string) =>
  ajax(
    createAJAXSettings(serverConfig, "/api/kernels", {
      headers: {
        "Content-Type": "application/json"
      },
      method: "POST",
      body: { path, name }
    })
  );
開發者ID:kelleyblackmore,項目名稱:nteract,代碼行數:10,代碼來源:kernels.ts


注:本文中的rxjs/ajax.ajax函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。