Type Alias RequestParameters

RequestParameters: {
    baseUrl?: Url;
    headers?: RequestHeaders;
    mediaType?: {
        format?: string;
        previews?: string[];
    };
    request?: RequestRequestOptions;
    [parameter: string]: unknown;
}

Parameters that can be passed into request(route, parameters) or endpoint(route, parameters) methods

Type declaration

  • [parameter: string]: unknown

    Any additional parameter will be passed as follows

    1. URL parameter if ':parameter' or {parameter} is part of url
    2. Query parameter if method is 'GET' or 'HEAD'
    3. Request body if parameter is 'data'
    4. JSON in the request body in the form of body[parameter] unless parameter key is 'data'
  • OptionalbaseUrl?: Url

    Base URL to be used when a relative URL is passed, such as /orgs/{org}. If baseUrl is https://enterprise.acme-inc.com/api/v3, then the request will be sent to https://enterprise.acme-inc.com/api/v3/orgs/{org}.

  • Optionalheaders?: RequestHeaders

    HTTP headers. Use lowercase keys.

  • OptionalmediaType?: {
        format?: string;
        previews?: string[];
    }

    Media type options, see Developer Guide

    • Optionalformat?: string

      json by default. Can be raw, text, html, full, diff, patch, sha, base64. Depending on endpoint

    • Optionalpreviews?: string[]

      Custom media type names of API Previews without the -preview suffix. Example for single preview: ['squirrel-girl']. Example for multiple previews: ['squirrel-girl', 'mister-fantastic'].

  • Optionalrequest?: RequestRequestOptions

    Pass custom meta information for the request. The request object will be returned as is.