gremlin
    Preparing search index...

    Represents an HTTP request that is passed through interceptors before being sent to the server. Interceptors may mutate any field. The serializeBody method serializes the body to JSON if it is still a RequestMessage, or returns the existing bytes if already serialized.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    body: any
    headers: Record<string, string>
    method: string
    url: string

    Methods

    • Serializes the request body to JSON if it is still a RequestMessage. If body is already a Buffer, returns it as-is (idempotent). Sets Content-Type and Content-Length headers on successful serialization.

      Returns Buffer

      The serialized body as a Buffer.

      Error if body is neither a RequestMessage nor a Buffer.