rest-vir - v1.2.6
    Preparing search index...

    Function buildEndpointRequestInit

    • Build request init and URL for fetching an endpoint. Used in fetchEndpoint.

      Type Parameters

      • const EndpointToFetch extends
            | typeof NoParam
            | Readonly<
                {
                    methods: _RequireAtLeastOne<Record<HttpMethod, boolean>, HttpMethod>;
                    path: `/${string}`;
                    requestDataShape: Shape | undefined;
                    responseDataShape: Shape | undefined;
                    service: { serviceName: string; serviceOrigin: string };
                },
            >

      Parameters

      • endpoint: EndpointToFetch extends EndpointDefinition
            ? EndpointToFetch<EndpointToFetch>
            : {
                methods: _RequireAtLeastOne<Record<HttpMethod, boolean>, HttpMethod>;
                path: `/${string}`;
                requestDataShape: Shape | undefined;
                responseDataShape: Shape | undefined;
                searchParamsShape: Shape<unknown> | undefined;
                service: { serviceName: string; serviceOrigin: string };
            }
      • ...__namedParameters: CollapsedFetchEndpointParams<EndpointToFetch, false>

      Returns { requestInit: RequestInit; url: string }