Properties of remote API route.

Jeongho Nam - https://github.com/samchon

interface IFetchRoute<
    Method extends "HEAD"
    | "GET"
    | "POST"
    | "PUT"
    | "PATCH"
    | "DELETE",
> {
    method: Method;
    path: string;
    request: Method extends "POST"
    | "PUT"
    | "PATCH"
    | "DELETE"
        ? null | IBody
        : null;
    response: Method extends "HEAD" ? null : IBody;
    status: null | number;
    template?: string;
    parseQuery(input: URLSearchParams): any;
}

Type Parameters

  • Method extends "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE"

Properties

method: Method

Method of the HTTP request.

path: string

Path of the HTTP request.

request: Method extends "POST"
| "PUT"
| "PATCH"
| "DELETE"
    ? null | IBody
    : null

Request body data info.

response: Method extends "HEAD" ? null : IBody

Response body data info.

status: null | number

When special status code being used.

template?: string

Path template.

Filled since 3.2.2 version.

Methods

  • Parser of the query string.

    If content type of response body is application/x-www-form-urlencoded, then this parseQuery function would be called.

    If you've forgotten to configuring this parseQuery property about the application/x-www-form-urlencoded typed response body data, then only the URLSearchParams typed instance would be returned instead.

    Parameters

    • input: URLSearchParams

    Returns any