当前位置: 首页>>代码示例>>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;未经允许,请勿转载。