DOIP Client Library - JavaScript Version
    Preparing search index...

    Class DoipResponse

    Represents a response from a DOIP operation.

    This class encapsulates the response data from a DOIP service, including status, attributes, and output. It provides methods to access this data and convert the response to different formats (JSON, ReadableStream, Body, or Error).

    Callers are generally responsible for calling close to ensure the network connection behind this response is closed. The asJson, asBody, asReadableStream, and asError methods automatically close the response.

    Index

    Constructors

    Methods

    • Gets the DOIP status of the response

      Returns string

      '0.DOIP/Status.001'
      
    • Gets all attributes from the response. The attributes that are available depend on the operation that was invoked.

      Returns undefined | Json

      The JSON object representing the attributes for this response

    • Gets a specific attribute from the response

      Parameters

      • key: string

      Returns undefined | Json

      The JSON associated with the given attribute, or undefined if not found

    • Gets the response as a DoipError object. This allows easy access to any error information in the response.

      Returns Promise<DoipError>

      A promise that resolves to a DoipError

    • Gets the response as a JSON object

      Returns Promise<Json>

      A promise that resolves to arbitrary JSON

    • Gets the response as a stream of bytes

      Returns Promise<ReadableStream<Uint8Array<ArrayBuffer>>>

      A promise that resolves to a ReadableStream

    • Get the response as a Body

      Returns Promise<Body>

      A promise that resolves to a Body

    • Close the response object and clean up resources, if needed

      Returns Promise<void>