Comunica
    Preparing search index...

    A base actor for listening to HTTP events.

    Actor types:

    • Input: IActionHttp: The HTTP request.
    • Test: IActorHttpTest: An estimate for the response time.
    • Output: IActorHttpOutput: The HTTP response.
    • IActionHttp
    • IActorHttpTest
    • IActorHttpOutput

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    beforeActors: Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>[] = []

    Actor that must be registered in the bus before this actor.

    bus: Bus<
        Actor<IActionHttp, IActorTest, IActorHttpOutput, undefined>,
        IActionHttp,
        IActorTest,
        IActorHttpOutput,
        undefined,
    >

    The bus this actor subscribes to.

    name: string

    The name for this actor.

    {<rdf:subject>}
    

    Methods

    • Creates an appropriate User-Agent header string for Node.js or other environments. Within browsers, returns undefined, because the value should not be overridden due to potential CORS issues.

      Parameters

      • actorName: string
      • actorVersion: string

      Returns undefined | string

    • Extract the requested URL from the action input.

      Parameters

      • input: RequestInfo | URL

        The request input.

      Returns URL

      The extracted URL.

    • Convert the given headers object into a raw hash.

      Parameters

      • headers: Headers

        A headers object.

      Returns Record<string, string>

    • Attempts to determine whether the current environment is a browser or not.

      Returns boolean

      True for browsers and web workers, false for other runtimes.

    • Sleeps for the specified amount of time, using a timeout

      Parameters

      • ms: number

        The amount of milliseconds to sleep

      Returns Promise<void>

    • Converts WhatWG streams to Node streams if required. Returns the input in case the stream already is a Node stream.

      Parameters

      • body: null | ReadableStream<any>

      Returns ReadableStream

      A node stream.