Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ServerConnection

The namespace for ServerConnection functions.

Notes

This is only intended to manage communication with the Jupyter server.

The default values can be used in a JupyterLab or Jupyter Notebook context.

We use token authentication if available, falling back on an XSRF cookie if one has been provided on the document.

A content type of 'application/json' is added when using authentication and there is no body data to allow the server to prevent malicious forms.

Index

Classes

Interfaces

Functions

Object literals

Functions

makeRequest

  • makeRequest(url: string, init: RequestInit, settings: ISettings): Promise<Response>
  • Make an request to the notebook server.

    throws

    If the url of the request is not a notebook server url.

    Notes

    The url must start with settings.baseUrl. The init settings are merged with settings.init, with init taking precedence. The headers in the two objects are not merged. If there is no body data, we set the content type to application/json because it is required by the Notebook server.

    Parameters

    • url: string

      The url for the request.

    • init: RequestInit

      The initialization options for the request.

    • settings: ISettings

      The server settings to apply to the request.

    Returns Promise<Response>

    a Promise that resolves with the response.

makeSettings

  • Create a settings object given a subset of options.

    Parameters

    • Optional options: Partial<ISettings>

      An optional partial set of options.

    Returns ISettings

    The full settings object.

Object literals

Const defaultSettings

defaultSettings: object

The default settings.

Headers

Headers: object = HEADERS

Type declaration

Request

Request: object = REQUEST

Type declaration

WebSocket

WebSocket: object = WEBSOCKET

Type declaration

appUrl

appUrl: string = PageConfig.getOption('appUrl')

baseUrl

baseUrl: string = PageConfig.getBaseUrl()

fetch

fetch: function = FETCH

Type declaration

    • (input: RequestInfo, init?: RequestInit): Promise<Response>
    • Parameters

      • input: RequestInfo
      • Optional init: RequestInit

      Returns Promise<Response>

token

token: string = PageConfig.getToken()

wsUrl

wsUrl: string = PageConfig.getWsUrl()

init

init: object

cache

cache: "no-store" = "no-store"

credentials

credentials: "same-origin" = "same-origin"

Generated using TypeDoc