Skip to content

resolveRestRouteUrl

resolveRestRouteUrl(routePath, root?): string

Defined in: wp-typia-rest/src/client.ts:145

Resolve a WordPress REST route into an absolute URL.

string

WordPress REST route such as /wp-typia/v1/items.

string = ...

Explicit REST root. Defaults to automatic WordPress discovery.

string

An absolute URL ready to pass to fetch() or apiFetch.

The resolver preserves query strings and hash fragments and supports both pretty permalink roots and rest_route query-style roots.

const url = resolveRestRouteUrl("/wp-typia/v1/items?limit=10");