Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HTTP

Enhanced HTTP client for the Kinto protocol.

Hierarchy

  • HTTP

Index

Constructors

constructor

Properties

Optional events

events: Emitter

requestMode

requestMode: RequestMode

timeout

timeout: number

Accessors

Static DEFAULT_REQUEST_HEADERS

  • get DEFAULT_REQUEST_HEADERS(): Record<string, string>
  • Default HTTP request headers applied to each outgoing request.

    Returns Record<string, string>

Static defaultOptions

Methods

_checkForBackoffHeader

  • _checkForBackoffHeader(headers: Headers): void

_checkForDeprecationHeader

  • _checkForDeprecationHeader(headers: Headers): void

_checkForRetryAfterHeader

  • _checkForRetryAfterHeader(headers: Headers): number | undefined
  • Parameters

    • headers: Headers

    Returns number | undefined

Private processResponse

  • processResponse<T>(response: Response): Promise<HttpResponse<T>>

request

  • Performs an HTTP request to the Kinto server.

    Resolves with an objet containing the following HTTP response properties:

    • {Number} status The HTTP status code.
    • {Object} json The JSON response body.
    • {Headers} headers The response headers object; see the ES6 fetch() spec.

    Type parameters

    • T

    Parameters

    • url: string

      The URL.

    • Default value request: RequestInit = { headers: {} }
    • Default value options: RequestOptions = { retry: 0 }

    Returns Promise<HttpResponse<T>>

Private retry

Private timedFetch

  • timedFetch(url: string, options: RequestInit): Promise<Response>
  • Parameters

    • url: string
    • options: RequestInit

    Returns Promise<Response>

Generated using TypeDoc