Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace 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

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.

Generated using TypeDoc