Options
All
  • Public
  • Public/Protected
  • All
Menu

The Response class serves as a container for and interface with the Cloud Office Print server's response to a printjob request. The Cloud Office Print server can also throw an error, in which case you will be dealing with a cloudofficeprint.exceptions.COPError instead of this class.

Hierarchy

  • Response

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Response(response: Response): Response
  • You should never need to construct a Response manually

    Parameters

    • response: Response

      Response object from the node-fetch package

    Returns Response

Properties

buffer

buffer: Promise<ArrayBuffer>

mimetype

mimetype: string

Methods

filetype

  • filetype(): string

toFile

  • toFile(path: string): Promise<void>
  • Write the response to a file at the given path without extension. If the given file path does not contain an extension, the correct path is automatically added from the response data. That is how this method is intended to be used. You should only specify the extension in the path if you have some reason to specify the extension manually.

    Parameters

    • path: string

      path without extension

    Returns Promise<void>

toString

  • toString(): Promise<string>
  • Return the string representation of this buffer. Useful if the server returns a JSON (e.g. for output_type 'count_tags').

    Returns Promise<string>

    string representation of this buffer

Generated using TypeDoc